EE2323:Microprocessors & Computer Architecture: February 25, 2013
EE2323:Microprocessors & Computer Architecture: February 25, 2013
org
EE2323:Microprocessors & • www.coursera.org
Computer Architecture • 123 Course offered by 60 Top Universities
• 2 Million online students
Spring 2013
Microprocessor Architectures
Number Systems
Lecture 3
February 25, 2013
2/25/2013 2
i80386
• If every microprocessor instruction executes in one • Related trends
i80286
100000
clock cycle then – Processor
performance
• CPI = 1 10000
i8086 Twice as fast after
~18 months
• MIPS = Processor clock in MHz i8080
– Memory capacity
i4004
• MIPS figure is used to compare performance of Twice as much in
1000
<2 years
different processors for a given algorithm 1970 1975 1980 1985 1990 1995 2000
Year
2/25/2013 7 2/25/2013 8
Evolution of Intel Architectures Evolution of Intel Architecture
• A common way to categorize processors is the Intel 4004 (1971): First Intel Processor
number of bits their ALU can process • 4 bit microprocessor. 4004 was used in
• 4KB main memory , 45 instructions Calculators.
• An n-bit µP mean, its ALU , its register file and • 2300 transistors , Clock : 108 KHz
most of its instructions are designed to work Intel 8008: (1972)
with n-bits • 8-bit microprocessor. Intel 8008 was twice as
powerful as Intel 4004
• Intel microprocessors can be categorized as : • 16KB main memory , 48 instructions.
• Clock : 500-800 KHz
– 4-bit Processors Intel 8080: (1974)
Altair8800 Computer
– 8-bit Processors • 8-bit microprocessor. was based on Intel 8080
• 64KB main memory, 4500 Transistors
– 16-bit Processors • Clock : 2 MHz
– 32-bit Processors Intel 8086: (1978), Intel 8088 (1979)
Intel 8088 was selected in
• Evolution of Intel processors started in 1971 with • 16-bit microprocessors
power IBM PC in 1981
• 1MB main memory , Clock : 5 MHz
the 4-bit processor 4004
• 4/6-byte instruction cache.
2/25/2013 9 • Segment Registers and memory Segmentation 10
2/25/2013 13 2/25/2013 14
• Every number system has different Base (Radix) – Weight = (10) Position
• Generalized representation of Number Systems • Magnitude 400 10 5 0.4 0.04
d2*B2+d1*B1+d0*B0 + d-1*B-1+d-2*B-2
Integer Part Fractional Part
• Formal Notation (415.44)10
2/25/2013 15 2/25/2013 16
Binary Number System Hexadecimal Number System
• Base (radix) = 2 • Base (radix) = 16
– 2 digits { 0, 1 }, also called “bits” – 16 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F }
• Weights 4 2 1 1/2 1/4 • Weights
Position 256 16 1 1/16 1/256
– Weight = (Base) 1 0 1 0 1 – Weight = (Base) Position
– Weight = (2) Position – Weight = (16) Position 1 E 5 7 A
2 1 0 -1 -2
• Magnitude • Magnitude 2 1 0 -1 -2
1 *2 +0 *2 +1 *2 +0 *2 +1 *2-2
2 1 0 -1
– Sum of “Bit x Weight” – Sum of “Digit x Weight” 1 *162+14 *161+5 *160+7 *16-1+10 *16-2
=(5.25)10
• Formal Notation =(485.4765625)10
(101.01)2
• Groups of bits • Formal Notation (1E5.7A)16
– 4 bits = Nibble {1 0 1 1}
– 8 bits = Byte {1 1 0 0 0 1 0 1}
– 16 bits = Word {1 1 0 0 0 1 0 1 1 1 0 1 0 1 0 0}
2/25/2013 17 2/25/2013 18
13/ 2 = 6 1 a0 = 1 175 / 8 = 21 7 a0 = 7
6 /2= 3 0 a1 = 0 21 / 8 = 2 5 a1 = 5
3 /2= 1 1 a2 = 1 2 /8= 0 2 a2 = 2
1 /2= 0 1 a3 = 1
Answer: (175)10 = (a2 a1 a0)8 = (257)8
Answer: (13)10 = (a3 a2 a1 a0)2 = (1101)2 Example (Fractional) : (0.3125)10
Example (Fractional) : ( 0.125 )10 Integer Fraction Coefficient
0.3125 * 8 = 2 . 5 a-1 = 2
Answer: = (0.001)2 0.5 *8= 4 . 0 a-2 = 4
Answer: (0.3125)10 = (0.a-1 a-2 a-3)8 = (0.24)8
2/25/2013 23 2/25/2013 24
Binary to Octal Conversion Binary − Hexadecimal Conversion
• Each group of 3 binary bits • 16 = 24 Hex Binary
represent an octal digit Octal Binary 0 0000
• Each group of 4 bits represents
• Starting from fractional point 0 000 a hexadecimal digit
1 0001
2 0010
combine binary bits in group of 3 1 001 3 0011
2 010 Assume Zeros 4 0100
Assume Zeros Example:
Example: 5 0101
3 011 6 0110
( 1 0 1 1 0 . 0 1 )2 ( 1 0 1 1 0 . 0 1 )2 7 0111
4 100 8 1000
5 101 9 1001
A 1010
6 110 B 1011
( 2 6 . 2 )8 7 111
(1 6 . 4 )16 C 1100
D 1101
E 1110
Works both ways (Binary to Hex & F 1111
Works both ways (Binary to Octal & Octal to Binary) Hex to Binary)
2/25/2013 25 2/25/2013 26
(1 6 . 4 )16
Works both ways (Octal to Hex & Hex to Octal)
2/25/2013 27 2/25/2013 28
1’s Complement 2’s Complements
• Complements are used by Computers for • 2’s Complement of a number is computed by :
simplification of Subtraction operation – Take 1’s complement and add 1 to LSB OR
• 1’s Complement of a number is obtained by – Toggle all bits to the left of the first ‘1’ from the
replacing right
– All ‘0’s by ‘1’s
Example:
– All ‘1’s by ‘0’s
Number:
Example : (10110000)2 10110000 10110000
1’s Comp.:
1’s Complement = (01001111)2 01001111
+ 1
• 1’s Complement is also used in logic operations
Complement of Complement of a Number is 01010000 01010000
original number
2/25/2013 29 2/25/2013 30
Signed Numbers :
Signed Numbers Representation 2’s Complement Representation
• Computers Represent Information in ‘0’s and ‘1’s • Positive numbers are represented in Binary with sign
bit as ‘0’
• For signed numbers sign information has to be
saved in 0’s and 1’s 0 Magnitude (Binary)
• In computers, signed Numbers are represented in
–Complement Form (2’s Complement) • Negative numbers are represented in 2’s Complement
form
1 Code (2’s Comp.)
• All signed number representations use the MSB to
represent the sign of number: Example
–‘0’ Positive Number (+3)10 (0 011)2
–‘1’ Negative Number (−3)10 (1 101)2
2/25/2013 31 2/25/2013 32