0% found this document useful (0 votes)
4 views

2. Computer and Memory Basics

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

2. Computer and Memory Basics

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Computer and Memory Basics

Md. Nazmul Abdal


Lecturer, Department of CSE
University of Liberal Arts
Bangladesh
Computer System Architecture

2
Architecture of Computer System
■ Computer is an electronic machine that makes performing any task very easy.
■ In computer, the CPU executes each instruction provided to it, in a series of
steps, this series of steps is called Machine Cycle, and is repeated for each
instruction.
■ Machine cycle involves fetching of instruction, decoding the
instruction, transferring the data, executing the instruction.
■ Computer system has five basic units that help the computer to perform
operations, which are given below:

1. Input Unit
- connects the external environment with internal computer system.
- It provides data and instructions to the computer system. Commonly used
input devices are keyboard, mouse, magnetic tape etc.
- Input unit perform following tasks:
✔ Accept the data and instructions from the outside environment.
✔ Convert it into machine language.
✔ Supply the converted data to computer system.
3
Architecture of Computer System

2. Output Unit
- It connects the internal system of a computer to the external environment.
- It provides the results of any computation, or instructions to the outside world.
- Some output devices are printers, monitor etc.

3. Storage Unit
- This unit holds the data and instructions.
- It also stores the intermediate results before these are sent to the output
devices.
- It also stores the data for later use.
- The storage unit of a computer system can be divided into two categories:
⮚ Primary Storage: This memory is used to store the data which is being
currently executed. It is used for temporary storage of data. The data is lost,
when the computer is switched off. RAM is used as primary storage memory.
⮚ Secondary Storage: The secondary memory is slower and cheaper than
primary memory. It is used for permanent storage of data. Commonly used
secondary memory devices are hard disk, CD etc.
4
Architecture of Computer System
4. Arithmetic Logical Unit
- All the calculations are performed in ALU of the computer system.
- The ALU can perform basic operations such as addition, subtraction,
division, multiplication etc.
- Whenever calculations are required, the control unit transfers the data
from storage unit to ALU. When the operations are done, the result is
transferred back to the storage unit.

5. Control Unit
- It controls all other units of the computer.
- It controls the flow of data and instructions to and from the storage unit
to ALU. Thus it is also known as central nervous system of the computer.

5
Instruction Execution

The CPU goes through the following steps to execute a machine


instruction (the fetch-execute cycle).

■ Fetch
■Fetch an instruction from memory
■Decode the instruction to determine the operation
■Fetch data from memory if necessary

■ Execute
■Perform the operation on the data
■Store the result in memory if needed

6
RAM (Random Access Memory)
■ Random Access Memory, often abbreviated as RAM, is a
hardware element of a computer where programs,
operating systems and data that’s currently being used is
stored so that the processor can retrieve it quickly.
■ RAM is one of the fastest types of memory in your
computer and can switch quickly between tasks.
■ These days, motherboards come with more than one RAM
slot, which gives you the flexibility to increase your RAM
capacity to achieve better operational speed.
ROM (Read Only Memory)

■ Commonly referred to as Read Only Memory.

■ ROM retains its contents even after the computer is


turned off.

■ ROM is a type of memory where data has been


prerecorded and contains the programming that helps
the computer boot up.

■ A good example of ROM is the computer BIOS that


stores the programming needed to begin the initial
computer start up process.
RAM vs ROM
RAM ROM
RAM stands for Random Access Memory. ROM stands for Read Only Memory.

RAM is a primary memory of the computer that ROM is a primary memory of the computer that
stores those data and instructions on which the stores those computer instructions and
CPU is currently working. programs that do not need to be altered in future
like BIOS.
RAM is a volatile memory. Which means it stores ROM is a non-volatile memory that means it
data as long as power is on. stores data permanently even when power is off.
The CPU of the computer can read, write, or CPU can only read data from ROM, but it can
alter the data on RAM. write or change.
RAM is used to store data that CPU needs for ROM is used to store data that in needed to
current instruction processing. bootstrap the computer.
There are two major types of RAM available – Three types of ROM available – PROM
SRAM (Static Random Access Memory) and (Programmable ROM), EPROM (Erasable
DRAM (Dynamic Random Access Memory). PROM), and EEPROM (Electrically EPROM).
The speed of RAM is quite high. The speed of ROM is slower than RAM.
CPU can access data stored on RAM directly. Data to be copied from ROM to RAM so that
CPU can access its data.
RAM memory is large and high capacity. ROM is generally small and of low capacity.

RAM is used as CPU Cache, Primary Memory. ROM is used as firmware by microcontrollers.
RAM is costly. ROM is not so expensive.
Buses

■ In isolation, the microprocessor, the memory and the


input/output ports are interesting components, but they cannot
do anything useful.

■ In combination, they can form a complete system if they can


communicate with each other.

■ This communication is accomplished over bundles of signal


wires that connect the parts of the system together. This wires
are known as system buses.

■ There are normally three types of bus in any processor system.


Buses

Address bus: This determines the location in memory that the processor will read
data from or write data to. The address bus consists of 16, 20, 24, or more parallel
signal lines, through which the CPU sends out the address of the memory
location. Address bus is unidirectional because the processor only wants to know the
address of the memory and I/O devices, but the external devices do not need
address because there is only one processor.

Data bus: This contains the contents that have been read from the memory location
or are to be written into the memory location. The data bus consists of 8, 16, 32 or
more parallel signal lines. The data bus lines are bidirectional. This means that the
processor wants to send data to the memory or I/O devices and the memory or I/O
devices wants to send data to the processor. Data bus transfers binary data and
information.

Control bus: This manages the information flow between components indicating
whether the operation is a read or a write and ensuring that the operation happens at
the right time. It is bidirectional. Typically, control bus signals are memory read,
memory write, I/O read, and I/O write.
How Bus Works?
■ To read the contents of a memory location, the CPU places the address of the
memory location on the address bus.
■ And it receives the data, sent by the memory circuits, on the data bus.
■ A control signal is required to inform the memory to perform a read operation.
The CPU sends the control signal on the control bus.

Bus connections of a
Microprocessor 12
Programming Language
■ Machine Language
■ A CPU can only execute machine language instructions.
■ Machine languages are the only languages understood by computers.

■ Why Humans Don't Use Machine Language?


■ While easily understood by computers, machine languages are almost
impossible for humans to use because they consist entirely of numbers.

■ Assembly Language
■ An assembly language is a programming language that can be used to
directly tell the computer what to do.
■ An assembly language is almost exactly like the machine code that a
computer can understand, except that it uses words in place of numbers.
■ A computer cannot really understand an assembly program directly.
However, it can easily change the program into machine code by
replacing the words of the program with the numbers that they stand for.
A program that does that is called an assembler.

13
Programming Language
■ Advantages Assembly Language:
■ Assembly Language has the same efficiency of execution as the machine level
language. Because this is one-to-one translator between assembly language program
and its corresponding machine language program.
■ A well written assembly language program produces a faster, shorter machine language
program.
■ It is easier to correct errors and modify program instructions.
■ The another reason for learning assembly language is it possible to gain a feeling for
the way the computer “thinks” and why certain things the way they do inside the
computer.
■ High-Level Language
■ A high-level language (HLL) is a programming language such as: C, C++, JAVA, C# that
enables a programmer to write programs that are more or less independent of a
particular type of computer.
■ Such languages are considered high-level because they are closer to human languages
and further from machine languages.
■ Ultimately, programs written in a high-level language must be translated into machine
language by a compiler or interpreter.
■ Advantage of High-Level Language
■ The main advantage of high-level languages over low-level languages is that they are
easier to read, write, and maintain.
14
THANK YOU

15

You might also like