ECE391 - Ch1 - Basics of Computer Systems
ECE391 - Ch1 - Basics of Computer Systems
1. History of CPUs
2. Intel x86 Processors
3. ARM processors
4. Memory
5. Computer Software
1. History of CPUs
1950s:
Ferranti Mark 1, 1951: from University of Manchester
single 80-bit accumulator , the 40-bit "multiplicand/quotient
register"
UNIVAC I (UNIVersal Automatic Computer I) designed
principally by J. Presper Eckert and John Mauchly, the
inventors of the ENIAC
1,905 operations per second running on a 2.25 MHz clock.
IBM 704 in 1957:
1
8/29/2022
1. History of CPUs
1960s:
IBM System/360 (S/360): 34,500 instructions per
second, with memory from 8 to 64 KB
PDP-11: developed by Digital Equipment Corporation
32 bit processor, allow 4 MB of physical memory
Motorola 68000:
Initial speed grades were 4, 6, and 8 MHz.
68k instruction set
1. History of CPUs
1970s:
Intel 4004 (1971):
a single instruction cycle was 10.8 microseconds
Clock rate is 1 MHz
2
8/29/2022
Evolutionary design
Backwards compatible up until 8086, introduced in 1978
Added more features as time goes on
3
8/29/2022
4
8/29/2022
Desktop Model
4 cores
Integrated graphics
3.3-3.8 GHz
65W
Server Model
8 cores
Integrated I/O
2-2.6 GHz
45W
8086 processor
40 pin dual in-line package
16-bit wide data bus
16-bit registers
20-bit external address bus
provides a 1 MB physical
address space
The maximum linear address
space is limited to 64 KB
Max CPU clock: 5- 10 MHz
10
5
8/29/2022
11
12
6
8/29/2022
AH AL AX (primary accumulator)
BH BL BX (base, accumulator)
CH CL CX (counter, accumulator)
DH DL DX (accumulator, other functions
13
SI Source Index
DI Destination Index
BP Base Pointer
SP Stack Pointer
Program counter:
IP Instruction Pointer
Segment registers:
CS Code Segment
DS Data Segment
ES Extra Segment
SS Stack Segment
14
7
8/29/2022
CS Code Segment
DS Data Segment
ES Extra Segment
SS Stack Segment
0110 1000 1000 0111 0000 Segment, 16 bits, shifted 4 bits left
+ 0011 0100 1010 1001 Offset, 16 bits
15
16
8
8/29/2022
17
source
%esi %si index
destination
%edi %di index
stack
%esp %sp
pointer
base
%ebp %bp
pointer
9
8/29/2022
3. ARM Processors
• ARM (Acorn RISC Machine) started as a new, powerful, CPU
design for the replacement of the 8-bit 6502 in Acorn
Computers (Cambridge, UK, 1985)
• First models had only a 26-bit program counter, limiting the
memory space to 64 MB (not too much by today standards,
but a lot at that time).
• 1990 spin-off: ARM renamed Advanced RISC Machines
20
10
8/29/2022
3. ARM Processors
• ARM now focuses on Embedded CPU cores
• IP licensing: Almost every silicon manufacturer sells
some microcontroller with an ARM core. Some even
compete with their own designs.
• Processing power with low current consumption
• Good MIPS/Watt figure
3. ARM Processors
• 32-bit CPU, Harvard architecture
• 3-operand instructions (typical): ADD Rd,Rn,Operand2
• RISC design:
• Few, simple, instructions
• Load/store architecture (instructions operate on registers, not
memory)
• Large register set
• Pipelined execution
22
11
8/29/2022
ARM9s
ARM7s and newers
and olders
Inst. Data
AHB
bus
I D
Cache Cache
MEMORY
& I/O
Bus Interface
AHB
Memory-mapped I/O: bus
• No specific instructions for I/O
(use Load/Store instr. instead) MEMORY
• Peripheral’s registers at some & I/O
memory addresses
23
ARM7TDMI Pipeline
1 Clock cycle
ARM9TDMI Pipeline
1 Clock cycle
24
12
8/29/2022
25
26
13
8/29/2022
27
Processor Modes
The ARM has seven operating modes:
28
14
8/29/2022
The Registers
ARM has 37 registers all of which are 32-bits long.
1 dedicated program counter
1 dedicated current program status register
5 dedicated saved program status registers
30 general purpose registers
29
cpsr
spsr spsr spsr spsr spsr spsr
30
15
8/29/2022
Special Registers
Special function registers:
PC (R15): Program Counter. Any instruction with PC as its destination
register is a program branch
CPSR : Current Program Status Register. Holds the visible status register
SPSR : Saved Program Status Register. Holds a copy of the previous status
register while executing exception or interrupt routines
- It is copied back to CPSR on the return from the exception or interrupt
- No SPSR available in User or System modes
31
4. Memory
Memory - Purpose of memory is data storage. Two major
types of memory :
16
8/29/2022
4. Memory
Primary memory consists of a set of locations defined
by sequentially numbered addresses. Each location
contains a binary number that can be interpreted as data
or an instruction.
8086 uses 20-bit physical address
Manage 1MB of memory
80386 uses 32-bit physical address
Manage 4GB of memory
X86-64 uses 64-bit physical address
Manage ??? of memory
33
u Memory locations are called words. Words are 8 bits (one byte) in size, or
a multiple of 8. Common word sizes are 16, 32 and 64 bits.
0 1 0 0 1 0 0 0 1
1
1 1 0 1 0 0 1 1
2
0 1 0 0 0 0 0 0
3
4 1 0 1 0 0 1 1 1
5 1 1 1 0 1 0 1 0
1 1 0 0 1 0 1 0
17
8/29/2022
2. Memory
1. 1 byte = 8 bits
FE ED FA CE
00 0x5 00 FE ED FA CE
00 0x4 00
CE 0x3 FE
FA 0x2 ED
ED 0x1 FA
FE 0x0 CE
Low Memory Addresses
36
18
8/29/2022
5. Computer Software
Assembly/Machine Code View
CPU Memory
Addresses
Registers
Data Code
PC Data
Condition Instructions Stack
Codes
Programmer-Visible State
PC: Program counter Memory
Address of next instruction Byte addressable array
Called “RIP” (x86-64)
Code and user data
Register file
Stack to support procedures
Heavily used program data
Condition codes
Store status information about most
recent arithmetic or logical operation
Used for conditional branching
37
5. Computer Software
Compiling Into Assembly
C Code (sum.c) Generated x86-64 Assembly
long plus(long x, long y); sumstore:
pushq %rbx
void sumstore(long x, long y, movq %rdx, %rbx
long *dest) call plus
{ movq %rax, (%rbx)
long t = plus(x, y); popq %rbx
*dest = t; ret
}
Obtain (on shark machine) with command
gcc –Og –S sum.c
Produces file sum.s
Warning: Will get very different results on non-Shark machines (Andrew Linux,
Mac OS-X, …) due to different versions of gcc and different compiler settings.
38
19
8/29/2022
Quiz
1) Pick the correct choice for the 8086 CPU.
A 16 bit word size, 8 bit data path
B 8 bit word size, 8 bit data path
C 16 bit word size, 16 bit data path
D 4 bit word size, 8 bit data path
E 8 bit word size, 16 bit data path
2) Pick the correct choice for the 80386SX CPU.
A 16 bit word size, 16 bit data path
B 32 bit word size, 16 bit data path
C 8 bit word size, 32 bit data path
D 32 bit word size, 8 bit data path
E 32 bit word size, 32 bit data path
3) Pick the correct choice for the 80486DX CPU.
A 32 bit word size, 16 bit data path
B 64 bit word size, 32 bit data path
C 32 bit word size, 32 bit data path
D 32 bit word size, 16 bit data path
E 32 bit word size, 64 bit data path
39
Quiz
4) What is the first CPU to include an internal math
coprocessor?
A 386DX
B 486SX
C 486DX
D Pentium
5) What are the two main components of the CPU?
A The Control Unit and ALU
B The Registers and Output/Input management
C The ALU and FPU
6) What are the two main desktop CPU manufacturers?
A Intel and AMD
B Via and Power PC Address Content
C Marek and Sun UltraSparc 0x4000 2F
7) What are the 32-bit data when we read a double-word at 0x4001 65
the address 0x4000 with Big Endian mode?
0x4002 7E
A 0xAC7E652F
B 0x2F657EAC 0x4003 AC
C 0xCAE756F2 40
20
8/29/2022
Quiz
8) Pick the correct choice for the ARM processor.
A 16 bit word size, 16 bit data path
B 32 bit word size, 16 bit data path
C 8 bit word size, 32 bit data path
D 32 bit word size, 8 bit data path
E 32 bit word size, 32 bit data path
9) Pick the wrong choice for ARM architecture.
A Von Neumann architecture
B Harvard architecture
C 3 stage pipeline architecture
D 32-bit ARM Instruction Set
10) Pick the wrong choice for ARM registers.
A ARM has 37 32-bit registers
B There are 13 general purpose registers
C R13 is Stack Pointer
D R14 is the program counter
41
Exercises
1. Suppose that you discover that RAM addresses 000C0000 to 000C7FFF are
reserved for a PC’s video adapter. How many bytes of memory is this?
2. Suppose that you have an Intel 8086. Find the five-hex-digit address that
corresponds to each of these segment:offset pairs:
(a) 2B8C:8D21 (b) 059A:7A04 (c) 1234:5678
3. In an 8086 program, suppose that the data segment register DS contains the
segment number 23D1 and that an instruction fetches a word at offset 7B86
in the data segment. What is the five-hex-digit address of the word that is
fetched?
4. In an 8086 program, suppose that the code segment register CS contains the
segment number 014C and that the instruction pointer IP contains 15FE.
What is the five-hex-digit address of the next instruction to be fetched?
5. What are advantages and disadvantage of secondary memory?
42
21