Computer Architecture - Indian Institute of Technology Kanpur

Download Report

Transcript Computer Architecture - Indian Institute of Technology Kanpur

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
Scalable
Single design – multiple use
© Intel Corp.
Design objectives

Maximize Performance



Maximize Productivity


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.
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


Servers


Processor for desktop computers. Cost, backward compatibility are very
important. Eg: Intel Pentium, AMD Athlon
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
(PC)
Instruction
Memory
Address
(reg)
Processor
Data
(loads)
Instruction
Data
(stores)
Data
Memory
Internal Structure of the Processor

Control Unit


ALU


Fetches instructions from memory, Interprets them, Controls ALU
Does all computations
Register File

Data
Out
Data
In
Data
Address
Stores variables
Register File
Instr
r1
r2
r3
r4
ALU
Data
(Calculator)
Control Control Unit
Flags
PC
Instr
In
Inst
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
(Like C, C++, Java)
void main ()
{
int a = 22;
int b = 42;
int c = a + b;
}

Assembly language
mov r1, 22
mov r2, 42
add r3, r1, r2
Destination
// Put the value 42 in R2
// Add the values in R1
& R2 and put result in R3
Source2
Source1
This conversion is done by compiler
// Put the value 22 in R1
Types of Instructions

ALU




MEM




add, sub, mult, or, and, xor
Operands may be Register-register, Register-memory, memory-memory
Immediate operands (will be discussed later)
load, store
Direct addressed:
Register Addressed:
load r1, 1234H
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 r1 to r31,
add r1, r2, r3
r1 = 00001, r31 = 11111
000111
6 bit opcode for
the add operation
is 000111
00001
00010
00011
Thus total length of
instruction = 6 + 5*3 = 21 bits
This is an example of fixed
length encoding scheme.
Number Systems
Decimal
(D)
Binary (B)
Hexadecimal
(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