CL17 – HACK Computer Architecture
The Big Picture
human thought
write a program
software hierarchy
VM translator
abstraction
compiler
high-level language
abstraction
VM code
abstraction
machine language
OS
p6
comb. and seq. Logic
p2 p3
assembler
abstraction
computer architecture
digital design
p4 p5
hardware platform
combinational logic
p1
abstraction
CPU, RAM, chipset
abstraction
elementary logic gates
Architecture vs Organization
Architecture – Customer visible features for an artifact Organization – Includes underlying details as well
In this chapter we will realize the HACK ARCHITECTURE with its ORGANIZATION based on – Instruction set definition (Chapter 4)
(Implemented) building block components (Chapters 1-3)
Stored Program Concept – von Neumann vs Harvard
von Neumann architecture
Harvard architecture
Computer Operation at a high level
FIFIELD
Fetch and Execute
Hack Computer – Abstraction
Memory: abstraction
fwm
i i
A Inst BTtformato
MA
Rz’saddresses O 2151
number
16 IN 1
Address 45
1K 1024
o T
DataVIi RAM 16kt
screen Isa gigs
keyboard cash l
Jhuqed i
Memory
Address 0 to 16383: data memory (16K)
Address 16384 to 24575: screen memory map Address 24576: keyboard memory map
16K_16 102416384
i
i
i 13831
I OUT b
non negative 7 is bit number3
RAM: abstraction and implementation
FLOAD
i i
na’Ims
14 II
16K
RAM 16 1024
24 210
214
E II
Implementation
qmigns fadehusbitsfw DataRAM 1922 14
on
Address
l n l
I
out
Screen: abstraction and implementation
food
loud
B Screenaddresscapacity_2ts
e addressbits
log 2B 13
Kaos builtinchipin Nand2Tetn’s it
display
address sc L n
4neenTi
out
youwillnot needto construct
forrealizingthe HACK Memory implementation
Screen memory map
Screen
Display Unit (256 by 512, b/w)
0 1 2 3 4 5 6 7 511
1111010100000000
0000000000000000
0011000000000001
0000101000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
1011010100000000
(16384) 0 1
31 32 33
63
8159 8160
8191
row 0
refresh
0 1
ooo
255
row 1
row 255
To set pixel (row,col) on/off:
(1) word=RAM[16384+32*row+col/16] (2) Setthe(col%16)thbitofwordto0or1 (3) RAM[ i ] = word
Keyboard: abstraction and implementation
TVs
2 9.110 002
t
address
E
lead
y
Keyboard memory map
Keyboard
000000000101010110011010
Scan-code of ‘k’ = 75
The Keyboard chip emits the scan-code of the currently pressed key, or 0 if no key is pressed.
k
Memory implementation
load
Memory 0
it7
in 16
address 15
RAM RAM
(16K) (16K)
Screen Screen
(8K memory (8K memory map)
out 16
in
16,383 16,384
our
24,575 map)
24,576
Keyboard
so qq.gg
g
addq
Instruction memory – abstraction and implementation
rm
f
Ima
F
Abstraction
Toadedviaemuletrai
Implementation
Builtin
mm
Hack Computer implementation
WnkM
1 Addie Instruction INST OUT
DATAIN
15 1 1 I
ROM32k
T
Instructions
CPU Reset
RAM
It
Addu.M lb Hour_
CPT
t OV
Reset
Load
Memoryo
Datascreen KBRD
Next Module – HACK CPU