Basic Structure of a Computer
Basic Structure of a Computer
Computer
A computer is an electronic device, operating under the control of instructions stored in its own
memory that can accept data (input), process the data according to specified rules, produce
information (output), and store the information for future use.
Computer Components
Any kind of computer consists of HARDWARE AND SOFTWARE.
Hardware:
Computer hardware is the collection of physical elements that make up the computer system.
Computer hardware refers to the physical parts or components of the computer such as the
monitor, mouse, keyboard, computer data storage devices, hard disk drive (HDD), system unit
(graphic cards, sound cards, memory, motherboard and chips), etc. all of which are physical
objects that can be touched.
Software
Software is a generic term for organized collection of computer data and instructions, often broken
into two major categories: system software that provides the basic non task-specific functions of
the computer, and application software which is used by users to accomplish specific tasks.
1
performed by the CPU. The group of operations (Instructions) that can be
recognized and executed by a given processor is known as the Instruction set.
Memory
(Primary memory)
RAM/ROM
Address Bus
I/O Interface
Output Device
Input Device
The control unit is responsible for program execution and operates as follows: (we will look at
the concept of program execution in more details later)
1. Read the code for the next instruction to be executed.
2. Increment the program counter so it points to the next instruction.
3. Read whatever data the instruction requires from locations in memory.
4. Provide the necessary data to an ALU or register.
5. If the instruction requires an ALU or specialized hardware to perform an operation to
complete the instruction, instruct the hardware to perform this requested operation.
Registers:
Registers are temporary memory locations within the processor. They store data that is
currently being used within the CPU. They act as "very fast storage areas" that can be directly
accessed by the ALU and the control unit.
There are two types of registers:
General Purpose registers. These are registers used hold user Data. Most processors use
Alphabetic characters to name these registers eg A,B, C etc.
2
Special Purpose registers. These are register that hold data that is of a specific nature, mainly
for use by the processor. Examples are Program Counter/ Instruction Pointer used by the
control unit to hold the address of the next instruction to be executed.
System buses: There are three buses that carry addresses (Address bus), Data (Data Bus) and
control signals (Control bus). A bus is a collection of conductive paths that carry electrical
signals from one point of an electrical circuit to another.
Primary Memory:-
1. RAM: Random Access Memory (RAM) is a memory scheme within the computer
system responsible for storing data on a temporary basis, so that it can be promptly
accessed by the processor as and when needed. It is volatile in nature, which means that
data will be erased once supply to the storage device is turned off. RAM stores data
randomly and the processor accesses this data randomly from the RAM storage. RAM is
considered "random access" because you can access any memory cell directly (as
opposed to sequential access) if you know the row and column that intersect at that cell.
Volatile memory is computer memory that requires power to maintain the stored
information. Most modern semiconductor volatile memory is either Static RAM (SRAM)
or dynamic RAM (DRAM). SRAM retains its contents as long as the power is connected
and is easy to interface but uses more transistors per bit. Dynamic RAM is more
complicated to interface and control and needs regular refreshing to prevent its contents
from being lost. However, DRAM uses only one transistor and a capacitor per bit,
allowing it to reach much higher densities and, with more bits on a memory chip, be
much cheaper per bit.
2. ROM (Read Only Memory): ROM is a permanent form of storage. ROM devices retain
their contents regardless of whether power supply to them is turned on or off. ROM devices
do not allow data stored on them to be modified.
Non-volatile memory is computer memory that can retain the stored information even
when not powered. Examples of non-volatile memory include read-only memory (ROM),
flash memory, most types of magnetic computer storage devices (e.g. hard disks, floppy
discs and magnetic tape) and optical discs
Secondary Memory: -
Secondary memory (also called secondary storage) stores data and programs permanently or semi-
permanently (referred to as non-volatile): its contents are retained after the power is turned off.
They are considered to be under the I/O subsystem.
3
Units of Measurement
Storage measurements: The basic unit used in computer data storage is called a bit (binary digit).
Computers use these little bits, which are composed of ones and zeros, to do things and talk to
other computers. All your files, for instance, are kept in the computer as binary files and
translated into words and pictures by the software. This two number system is called a “binary
number system” since it has only two numbers in it. The decimal number system in contrast has
ten unique digits, zero through nine.
Computer Storage units
Bit bit 0 or 1
Byte B 8 bits
Kilobyte KB 1024 bytes
Megabyte MB 1024 kilobytes
Gigabyte GB 1024 megabytes
Terabyte TB 1024 gigabytes
Petabyte PB 1024 Terabytes
Exabyte EB 1024 Petabytes
Speed measurement: The speed of the Central Processing Unit (CPU) is measured by the Hertz
(Hz), which represents a CPU cycle. The speed of the CPU is taken as the Computer Speed.
CPU SPEED MEASURES
1 hertz or Hz 1 cycle per second
1 MHz 1 million cycles per second or 1,000,000 Hz
1 GHz 1 billion cycles per second or 1,000,000,000 Hz
The memory consists of storage cells, each capable of storing one bit of information. The storage
cells are group into storage locations one byte in size. Generally, cells can be group into units
different from 8bits in what is called a word. Word sizes range from 8- 64 bits (1 byte to 8
bytes).
To provide access to any word in the memory, a distinct address is allocated to each storage
location.
The number of bits in each word is often referred to as the word length of the computer.
4
communication links for interfacing them with the central processing unit. The purpose of
communication link is to resolve the differences that exist between the central computer and
each peripheral.
1. Peripherals generate different signals from the ones used by CPU and memory.
Therefore, a conversion of signal values may be needed.
2. The data transfer rate of peripherals is usually slower than the transfer rate of
CPU and consequently, a synchronization mechanism may be needed.
3. Data codes and formats in the peripherals differ from the word format in the
CPU and memory.
4. The operating modes of peripherals are different from each other and must be
controlled so as not to disturb the operation of other peripherals connected to the CPU.
To Resolve these differences, computer systems include special hardware components between
the CPU and Peripherals to supervises and synchronizes all input and out transfers
These components are called Interface Units because they interface between the processor bus
and the peripheral devices.
5
Parts of an I/O Module
Control signals: determine the function that will be performed
Data: set of bits to be sent or received
Status signals: indicate the state of the device
Control logic: controls the operations of the device
Transducer: converts data from electrical to other forms and vice versa
Buffer: temporarily holds data being transferred
In this mode of data transfer, the operations are performed by executing a computer program.
Each data transfer is initiated by an instruction in the program. Normally the transfer is from a
CPU register to peripheral device or vice-versa.
Once the data is initiated the CPU starts monitoring the interface to see when next transfer can
be made. The instructions of the program keep close tabs on everything that takes place in the
interface unit and the I/O devices.
6
The main drawback of the Programmed I/O is that the CPU has to monitor the units all the
times when the program is executing. Thus the CPU stays in a program loop until the I/O unit
indicates that it is ready for data transfer. This is a time consuming process and the CPU time is
wasted a lot in keeping an eye to the executing of program.
Interrupt-Initiated I/O :
In this method, an interrupt signal is used to inform the device about the start and end of
transfer. In the meantime, the CPU continues executing other program(s). When the interface
determines that the device is ready for data transfer it generates an Interrupt Request and sends
it to the computer.
When the CPU receives such an interrupt signal, it temporarily stops the execution of the
program and branches to a service program to process the I/O transfer and after completing it
returns back to main program (originally executing program). Whenever any device wants the
attention, it sends the interrupt signal to the CPU.
In the Direct Memory Access (DMA) the interface transfers the data into and out of
the memory unit through the memory bus. The transfer of data between a fast storage
device such as magnetic disk and memory is often limited by the speed of the CPU.
Removing the CPU from the path and letting the peripheral device manage the memory
buses directly would improve the speed of transfer. This transfer technique is called
Direct Memory Access (DMA).
During the DMA transfer, the CPU is idle and has no control of the memory buses. A DMA
processor takes over the buses to manage the transfer directly between the I/O device and
memory.
Input/Output Processor:
I/O Processor provides the path for transfer of data between various
peripheral devices and memory.
Data formats of peripherals differ from CPU and memory. The I/O
Processor mitigates such problems.
7
8