SCRAM Introduction
Philipp Koehn 13 September 2019
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
SCRAM Introduction Philipp Koehn 13 September 2019 Philipp Koehn - - PowerPoint PPT Presentation
SCRAM Introduction Philipp Koehn 13 September 2019 Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019 A Simple Computer 1 Fully work through a computer circuit assembly code Simple but Complete
Philipp Koehn 13 September 2019
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
1
– circuit – assembly code
– every instruction is 8 bit – 4 bit for op-code: 9 different operations (of 16 possible) – 4 bit for address: 16 bytes of memory
"The SCRAM"
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
2
Operation Code Description HLT 0000 Halt, stop execution LDA 0001 Load value from memory into accumulator LDI 0010 Indirectly load value from memory into accumulator STA 0011 Store value from accumulator into memory STI 0100 Indirectly store value from accumulator into memory ADD 0101 Add value from memory to accumulator SUB 0110 Subtract value from memory from accumulator JMP 0111 Jump to specified address JPZ 1000 Jump to specified address if zero flag is set
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
3
– loads the value from address x
– looks up the value at address x – treats that value as an address – loads the value at that address
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
4
Instruction Data 0 0 0 1 0 1 0 1 LDA 5 Load contents from address 5 into memory
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
5
Address Code Meaning
data
data 0001 0100 LDA 4 1 0101 0101 ADD 5 2 0011 0100 STA 4 3 0111 0000 JMP 4 1111 0000 DAT 5 1111 0001 DAT 1
DAT is not a real instruction
0, 1, 2, 3, 4, ..., 255, 0, ....
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
6
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
7
⇒ 16 different values ⇒ 16 byte address space
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
8
– can be directly accessed from logic units – used to store the results of computations
– memory address of current instruction
– contains current instruction – breaks it down into operation code
– memory access register (MAR): address to retrieve value – memory buffer register (MBR): retrieved value
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
9
– operand 1: accumulator – operand 2: adress specified in instruction – result: accumulator
result of operation is zero
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
10
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
11
microprogram (sequence of register transfers)
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
12
+---------------------------------+---------------------------------+ | | | | | Memory | | Program Counter (PC) | | | | Memory access register (MAR) | | Instruction Register (IR) | | | | Memory buffer register (MBR) | | | | +---------------------------------+---------------------------------+ | | | | | | | | Accumulator (A) | | Control Logic Unit (CLU) | | | | Arithmetric Logic Unit (ALU) | | | | | | | +---------------------------------+---------------------------------+
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
13
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
14
DI DO W A
– address (A) – data in (DI) – write flag (W)
– data out (DO)
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
15
DI DO W A
W W
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
16
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
17
DI DO W A
W W
W INC
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
18
DI DO W A
W W
W INC
W
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
19
copy PC value to memory access register (MAR)
retrieve address value into memory buffer register (MBR)
copy MBR value into instruction register (IR)
increase PC
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
20
DI DO W A
W W
W INC
W
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
21
DI DO W A
W W
W INC
W
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
22
DI DO W A
W W
W INC
W
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
23
DI DO W A
W W
W INC
W
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
24
Time Command t0 MAR ← PC t1 MBR ← M t2 IR ← MBR t3 PC ← PC + 1
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
25
retrieving data from memory ⇒ These steps can be parallized
Time Command t0 MAR ← PC t1 MBR ← M, PC ← PC + 1 t2 IR ← MBR
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
26
DI DO W A
W W
W INC
W
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
27
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
28
DI DO W A
16x8 RAM MAR MBR
W W
PC
W INC
IR
W
Decoder Control Logic Unit
C D Q
Instruction:
Control logic unit receives operation code Op-code is decoded into 9 different operations
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
29
DI DO W A
16x8 RAM MAR MBR
W W
PC
W INC
IR
W
Decoder Control Logic Unit
C D
T
INC CLEAR
NOT
Q
Time step needs to be increased
after each micro command
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019
30
DI DO W A
16x8 RAM MAR MBR
W W
PC
W INC
IR
W
Decoder Control Logic Unit
C D
T
INC
Decoder
CLEAR
NOT
Q T
Time step triggers one command line in control logic unit
Philipp Koehn Computer Systems Fundamentals: SCRAM Introduction 13 September 2019