Computer Architecture
Abhinav Agarwal
Veeramani V.
Outline
Introduction of a Microprocessor
Microprocessor design objectives and constraints
Structure
Interface
ISA
Microprocessor Instructions
Number Systems
What is a Microprocessor?
A circuit of transistors and other
electrical components on a chip that can
process programs, remember
information, or perform calculations.
The heart of every CPU
Requires programmed input
Advantages over a customised digital
circuit
Cost © Intel Corp.
Scalable
Single design – multiple use
Design objectives
Maximize Performance
Speed of operation: How quickly an operation can be completed
Throughput: No of operations completed in unit time, not necessarily
the same as speed, consider Servers.
Maximize Productivity
Interface provided must be easy
Be one step ahead of market needs and two steps
ahead of competition
Dramatic progress over the years
© Intel 4004 Processor © Intel P4 Processor
Introduced in 1971 Introduced in 2000
2300 Transistors 42,000,000 Transistors
108 KHz Clock 1.5 GHz Clock (Initial)
Design Constraints
Power consumed
Today’s processors consume a peak power of 100 W, which means a
peak current of nearly 80A.
Area
Cost
Backward compatibility
Windows running on Intel P3 Processor should run on Intel P4 too.
Time taken to design the processor should not be very
large or else the competitor may get ahead
Other factors like security, scalability, reliability also need
to be considered in processor design
Microprocessor Markets
Desktop
Processor for desktop computers. Cost, backward compatibility are very
important. Eg: Intel Pentium, AMD Athlon
Servers
Processor for applications requiring huge amount of computation, data
handling like web servers, database servers, scientific computation
servers. In general, multiple processors are used. Throughput is a very
important metric for servers in general. Eg: Google servers, vsnlproxy
Embedded
For applications in electronic appliances, robots, cars, mobiles etc.
Power consumption, cost are very important metrics. Eg:
Microcontrollers like 8051, PIC, specifically designed processors for
cars, mobiles etc.
Structure
The processor is a computing unit which needs to
interact with memory for getting instructions as well as
data
Address Address
(PC) (reg)
Instruction Processor Data
Memory Data Memory
(loads)
Instruction
Data
(stores)
Internal Structure of the Processor
Control Unit
Fetches instructions from memory, Interprets them, Controls ALU
ALU
Does all computations
Register File
Stores variables
Data Instr
Out Register File Instr In
r1
r2
r3
r4 ALU
Data Data (Calculator) Control Control Unit
Inst
In Flags Address
PC
Data
Address
Instruction set architecture (ISA)
The first step in any processor design would be to decide
on an ISA
ISA is the interface provided by the architect to the
external world
The instructions supported with their opcode (The binary representation
of instruction mnemonics)
The width (number of bits) of data, instruction, data address, instruction
address
Other information necessary to the compiler like number of registers in
the register file etc.
Assembly Code
High Level Language Assembly language
(Like C, C++, Java)
void main () mov r1, 22 // Put the value 22 in R1
{ mov r2, 42 // Put the value 42 in R2
int a = 22; add r3, r1, r2 // Add the values in R1
& R2 and put result
int b = 42; in R3
int c = a + b;
} Destination Source2
Source1
This conversion is done by compiler
Types of Instructions
ALU
add, sub, mult, or, and, xor
Operands may be Register-register, Register-memory, memory-memory
Immediate operands (will be discussed later)
MEM
load, store
Direct addressed: load r1, 1234H
Register Addressed: load r1, (r2)
Control
jmp, branch
Change value of PC to required location
Converting Instructions to binary codes
Each instruction is encoded into a binary format and
stored in the instruction memory.
The control unit decodes it and gives appropriate signals
to ALU Assuming that the register file
has 32 registers, each
register has a 5 bit code, from
add r1, r2, r3 r1 to r31,
r1 = 00001, r31 = 11111
000111 00001 00010 00011 Thus total length of
instruction = 6 + 5*3 = 21 bits
6 bit opcode for
the add operation This is an example of fixed
is 000111
length encoding scheme.
Number Systems
Decimal Binary (B) Hexadecimal
(D) (H or X)
Zero 0 0 0
Nine 9 1001 9
Ten 10 1010 A
Eleven 11 1011 B
Twelve 12 1100 C
Thirteen 13 1101 D
Fourteen 14 1110 E
Fifteen (Largest 4 bit no.) 15 1111 F
Forty Two 42 0010 1010 2A
Largest 8 bit no. 255 1111 1111 FF
Largest 16 bit no. 65535 1111 1111 1111 1111 FF FF
References
“How Microprocessors work”
http://www.intel.com/education/mpworks/index.htm
http://www-inst.eecs.berkeley.edu/~cs152/fa05/ppt/
lec1-1.ppt Slides 24-28
lec1-2.ppt
lec2-1.ppt