Lecture 2
Lecture 2
• Control Unit – A control unit (CU) handles all processor control signals. It directs all input
and output flow, fetches code for instructions, and controls how data moves around the
system.
• Arithmetic and Logic Unit (ALU) – The arithmetic logic unit is that part of the CPU that
handles all the calculations the CPU may need, e.g. Addition, Subtraction, Comparisons. It
performs Logical Operations, Bit Shifting Operations, and Arithmetic operations.
Basic CPU structure, illustrating ALU
Registers
1.Registers – Registers refer to high-speed storage areas in the CPU. The data processed by
the CPU are fetched from the registers. There are different types of registers used in
architecture :-Accumulator: Stores the results of calculations made by ALU. It holds the
intermediate of arithmetic and logical operatoins.it act as a temporary storage location or
device.
2.Program Counter (PC): Keeps track of the memory location of the next instructions to
be dealt with. The PC then passes this next address to the Memory Address Register
(MAR).
3.Memory Address Register (MAR): It stores the memory locations of instructions that
need to be fetched from memory or stored in memory.
4.Memory Data Register (MDR): It stores data fetched from memory or any data that is to
be transferred to, and stored in, memory.
5.Current Instruction Register (CIR): It stores the most recently fetched instructions
while it is waiting to be coded and executed.
6.Instruction Buffer Register (IBR): The instruction that is not to be executed
immediately is placed in the instruction buffer register IBR.
Input and Output Unit
• Input: Computer accept coded information through input unit. The most
common device is Keyboard. Whenever key is pressed, the corresponding
letter or digit is automatically translated into its corresponding binary code
and transmitted over a cable to either memory or the processor.
• Output: The output unit is the counterpart of the input unit. Its function is
to send processed results to the outside world. The most familiar device is a
printer. Some units, such as graphical displays, provide both an input and
output function.
Memory
• The function of the memory unit is to store programs and data. There are two classes
of storage, called as Primary and Secondary.
• Memory in which any location can be accessed in short and fixed amount of time
after specifying address is called Random Access Memory (RAM). CPU is known as
RAM because CPU can access any locations at any point of time.
Memory Con’d
• The smaller and fasted unit is called Cache. The largest and slowest unit
is referred to as main memory.
13
Secondary memory
14
Secondary memory
Non-volatile memory
Low speed
15
Cache memory
High speed memory placed between CPU and main memory
Stores data and instructions currently to be executed
More costlier but less capacity than main memory
Users can not access this memory
16
Buses – Data is transmitted from one part of a computer
to another, connecting all major internal components to
the CPU and memory.
Types:
• Data Bus: It carries data among the memory unit, the I/O
devices, and the processor.
• Address Bus: It carries the address of data (not the actual
data) between memory and processor.
• Control Bus: It carries control commands from the CPU (and
status signals from other devices) in order to control and
coordinate all the activities within the computer.
High level Programming Languages
In computer science, a high-level programming language is
a programming language with strong abstraction from the
details of the computer.
2. High level language is less memory efficient. Low level language is high memory efficient.
6. It is portable. It is non-portable.