Computer Architecture and
Microprocessors
CMP 263
Shuvra Baral
baralshuvra@gmail.com
Pokhara College of Management
• Books
• Ramesh Gaonkar: Microprocessor Architecture, Programming, and
Application with 8085
• Douglas Hall: Microprocessor and Interfacing programming and
Hardware
• John Uffenbeck: Microcomputers and Microprocessors, The
8080, 8085 and Z-80 programming, Interfacing and Troubleshooting
• Traditional Block diagram of a Computer
CPU
Arithmetic Logic
Unit (ALU)
Input Control Unit Output
Memory
Block diagram of a Computer
• The block diagram shows four components: memory, input , output
and the Central Processing Unit (CPU)
• CPU consists of ALU and Control unit.
• CPU consists of various registers to store data
• ALU to perform arithmetic and logical operations,
• CPU reads instructions from the memory and performs the tasks
specified
• It communicates with the input/output devices (peripherals) either to
accept or to send data
• CPU communicates with memory, input and output which is
controlled by the group of circuits called the control unit
Introduction to Microprocessors
• A microprocessor is a computer processor that incorporates the
functions of a central processing unit on a single integrated
circuit (IC), or small number of integrated circuits
• It has ALU, a control unit, registers, bus systems and clock to perform
computational tasks
• It is a programmable, multipurpose registered-based device that
reads binary instructions
• Used in – tv remote, traffic light, computer- where programming is
involved
• Block Diagram of a Computer with the Microprocessor as CPU
Microprocessor as
CPU
ALU
Array
Input Register Output
Control Unit
Memory
Block diagram of a Computer with Microprocessor as CPU
• Arithmetical Logical Unit (ALU)
• Performs computing functions on data
• Performs arithmetic operations such as addition and subtraction and
logical operations such as AND, OR and exclusive OR
• Register Unit
• It consists of various registers
• Registers are used primarily to store data temporarily during the execution of
a program
• Memory
• Can store instructions, data and intermediate results
• Supplies information to other units of the computer when needed
• Also known as Main memory or primary storage
• Its size affects speed, power and capability
• All inputs and outputs are transmitted through the main memory
• Control Unit
• Controls the operations of all parts of the computer but does not
carry out any actual data processing operations
• It is responsible for controlling the transfer of data and instructions
among other units of a computer
• It managers and coordinates all the units of the computer
• It obtains the instructions from the memory, interprets them and
directs the operation of the computer
• It communicates with I/O devices for transfer of data or results from
storage
• It does not or process or store data
• Disk Storage Unit
Data and instruction enter into a computer system through input
device have to be stored inside the computer before actual
processing start. Two types of storage units are the primary and
secondary storage units.
• Primary Storage Unit
Primary memory has a direct link with the input unit and output unit.
It stores the input data, calculation results.
• Secondary Storage Unit
The primary storage is not able to store data permanently for future
use. So some other types of storage technology are required to store
the data permanently for a long time, it is called secondary or
auxiliary storage.
• Features of Microprocessor
• Low Cost – Due to integrated circuit technology microprocessors are
available at very low cost. It will reduce the cost of a computer system.
•
High Speed – Due to the technology involved in it, the microprocessor can
work at very high speed. It can execute millions of instructions per second.
•
Small Size – A microprocessor is fabricated in a very less footprint due to
very large scale and ultra large scale integration technology. Because of
this, the size of the computer system is reduced.
•
Versatile – The same chip can be used for several applications, therefore,
microprocessors are versatile.
• Low Power Consumption – Microprocessors are using metal
oxide semiconductor technology, which consumes less power.
• Less Heat Generation – Microprocessors uses semiconductor
technology which will not emit much heat as compared to vacuum
tube devices.
• Reliable – Since microprocessors use semiconductor technology,
therefore, the failure rate is very less. Hence it is very reliable.
• Portable – Due to the small size and low power
consumption microprocessors are portable.
• Generation of Microprocessor
• 1st Generation: (1971 – 1973)
• 1971, INTEL created the first microprocessor 4004
• With only 4 bits as the word size, the 4004 could only represent
signed numbers in the range of –8 to +7 (very small)
• Performs simple logical operations such as addition, subtraction,
Boolean OR and Boolean AND
• Not of practical use of arithmetic calculations.
• Had a control unit capable of performing control functions like
fetching an instruction from storage memory, decoding it, and then
generating control pulses to execute it.
• 2nd Generation (1972)
• 1972, INTEL 8008 was the next evolution – first 8-bit microprocessor
• Followed by Intel 8080 – 8 bit microprocessor (first commercially
popular 8 bit microprocessor)
• 8 bit as word size, represents signed numbers in the range of –128 to
+127.
• Not enough range for performing arithmetic calculations.
• 8080 was used only for control applications
• 6800 Motorola and Z-80 Zilong were also popular at that time
• 3rd Generation (1978)
• First 16-bit microprocessor Intel 8086
• Represent signed numbers in the range on –32,768 to +32,767
• Decent range for performing arithmetic calculations
• Popular for not only control applications, but also for arithmetic
calculation
• Speed of the processors was 4 times faster than 2nd generation
• Motorola came out with 68000 with 16 bit processor
• Zilong released Z-8000 16 bit processor
• 4th Generation (Early 80's)
• Intel 80386, -32 bit processor by using HCMOS (high-density CMOS)
fabrication.
• Represents signed numbers in the range –2 * 9th power of 10 to +2 *
9th power of 10, which is quite large range for performing arithmetic
calculations
• If floating point notation is used, it represent much larger numbers
• Became very popular the CPU in computers for number crunching
operation
• Motorola came out with 68020 32 bit processor
• Intel released 80386 processor and 80387 numeric co-processor on a
single chip
• Motorola released 68030
• In early 90's, Intel released 80586 by the name of Pentium processor
• Extremely fast in performing arithmetic calculations and
executing instructions
• Pentium 4 released on 2000 has 42 million transistors worked with a
clock frequency of 1.5 GHZ.
• 5th Generation (1995 – until now)
• High performance and high speed processors that make is of 64 bit
processors
• After 80856, Intel came out with a new processor namely Pentium
processor followed by Pentium Pro CPU, which allows multiple CPUs
in a single system to achieve multiprocessing. Other improved 64-bit
processors are Celeron, Dual, Quad, Octa Core processors.
• Very cheap compared to main frame computers
• Bus organization with Microprocessor System
CPU Memory Input and Output
Control Bus
System Bus
Address Bus
Data Bus
• Main parts of microcomputer (CPU, memory and I/O unit) are
connected through three sets of parallel lines called buses
• Address Bus , Data Bus and Control Bus
• Address Bus: collection of wired used to identify particular in main
memory
• The address bus holds the address of the data present in the memory
• It is used to identify the source or destination of data
• e.g: If CPU wants to read a data from a memory, first it has to identify
the location of that data. This is unidirectional, this means the CPU
can send data to a memory location or I/O Device
• When the CPU reads data from or writes data to a port in the address
is also sent out on the address bus
• Data Bus: It consists of 8 , 16, 32 …. or more parallel signal lines.
• Each lines carry only one bit
• It is bidirectional
• This means that the CPU can read data from memory or I/O port as
well as send data to a memory location or to a I/O port
• In a system, many output devices are connected to the data bus, but
only tone device at a time will be enabled t the output.
• Control Bus:
• It consists of 4-10 parallel signal lines
• It regulates the activity on the bus. (when the send data on the data
bus and when to read the address on the address bus)
• To read a data from a memory location, the CPU sends out
the address of the desired data on the address bus and then sends
out a memory read signal on the control bus
• The memory read signal enables the addressed memory
device to onto the data bus where it is read by the CPU
• Typically control bus signals are memory read, memory write, I/O
read and I/O write
• Stored Program Concept and its Processing Cycle
Memory Holding
Both data and program
Control Unit Arithmetic Logic Unit
Accumulator
Input Output
The Von Neumann or Stored Program Architecture
• A stored program is a program that is stored in the memory of
a computer
• The execution of the program required the use of a control unit –
to read instructions from the memory at appropriated times
and arrange to carry them out
• The memory used to store the program may be the same as
or different from memory used to store data
• There are advantages in using the same (read-write)
memory, allowing programs to be modified, but there may be
advantages in limiting opportunities for program modification, either
by using physically read-only memory or by restricting access to the
part of the memory containing program
• Storage of instructions in computer memory to enable it to perform a
variety of tasks in sequence or intermittently
• The idea was introduced in the late 1940s by John Von Neumann
• Neumann proposed that a program can be electronically stored in
binary number format in a memory device so that instructions could
be modified by the computer as determined by intermediate
computational results.
• Hardwired Control Unit v/s Micro programmed Control Unit
• To execute an instruction, the control unit of CPU must generate the
required control signal in the proper sequence.
• There are two approaches used for generating the control signals in
proper sequences : Hardwired Control Unit and Micro-programmed
control unit.
• Hardwired Control Unit:
• Hardwired control unit is implanted as a sequential logic circuit with
gates, flip-flops, decoders and other digital circuits that generates a
specific sequence of control signals
IR Instruction register
Status signals Sequential
Logic Circuit Control signals
Clock
• It uses fixed logic
• Interprets and then generates corresponding control signals
Instruction Register
15 14 13 12 11 10 9 …................. 0
Other inputs
3*8
I Decoder Combinational
Control Logic
76543210
D0
D7 Control
Signal
T15
T0
15 14 13 210
4 *16 decoder
Increment (INR)
4 bit
Sequence Counter Clear (CLR)
(SC) Clock
• Hardwired Control Unit consists of
• Instruction registers
• Number of control gates
• Two decoders
• 4-bit sequence counter
• An instruction read from memory is placed in the IR
• Instruction register --- I bit (15) last bit
--- Operation code ( 12-14) next 3 bits
--- Address part (0-11) first 12 bits
I = 0 for direct address
= 1 for indirect address
• First 12 bits (0-11) are applied to control logic gates
• The operation code bits (12-14) are decoded with 3*8 decoder
• The 8 output (D0-D7) from a decoder goes to the control logic gates
to perform specific operation
• Last bit 15 is transferred to a I flipflop
• The 4 bit sequence counter (SC) can count in binary from 0-15
• The counter output is decoded into 16 timing pulses T0-T15
• The sequence counter can be incremented by INR Input or clear by
CLR synchronously
• In the hardwired control, the control units use fixed logic circuit to
interpret instructions and generate control signals from them.
• Hardwired control is faster than microprogrammed control
• A controller that uses this approach can operated at high speed.
• This organization is very complicated if we have a large control unit.
• In this organization, if design has to be modified or changed,
requires changes in the wiring among the various components.
• Thus the modification of all the combinational circuits may be very
difficult.
• Advantages
• Hardwired control unit is fast because control signals are generated
by combinational circuits
• The delay in generation of control signals depends upon the number
of gates
• It has greater chip area efficiency since it uses less area in chip
• Disadvantages
• More the control signals required by CPU, more complex will be
design on control unit
• A modification in control signal is very difficult. That means it requires
rearranging of wired in the hardware circuit
• It is difficult to correct mistake in original design or adding new
features in existing design of control unit.
• Micro Programmed Control Unit
• Micro programmed control unit use sequence of micro instruction in
micro programming language
• Acts a mid-way between hardware and software
• Generates set of control signals on the basis of control lines
• It is easy to design, test and implement and flexible to modification
• It is implemented using programming approach
• A sequence of microoperation are carried out by executing a program
consisting of micro-instruction
• Micro-program consisting of micro-instruction is stored in the control
Memory (ROM) of the control unit.
• Execution of a micro-instruction is responsible for generation of a set
of control signals
• Architecture Micro Programmed Control Unit
Instruction Register
Next address Control
generator Address Register
Control
Memory
Control
Data Register
Next address information
Control Word
• The address of micro-instruction that is to be executed is stored in the
Control Address Register (CAR)
• Micro-instruction corresponding to the address stored in CAR is
fetched from Control Memory and stored in the Control Data Register
(CDR)
• This micro instruction contains control word to execute on or more
micro-operation
• After the execution of all micro-operations of micro-instruction, the
address of next micro-instruction is located.
• Advantages
• Less complex to design because micro programs are implemented
using software routines
• It is more flexible because design modification, correction and
enhancement is easily possible
• It can be changed to accommodate new system specification to
correct the design errors quickly and cheaply
• Less error prone to implement
• Disadvantages
• It is slower than the hardwired control unit, because time is required
to access the microinstruction from control memory
• The design duration of micro-program control unit is more than
hardwired control unit for smaller CPU.