-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
39 lines (31 loc) · 1.35 KB
/
Copy pathREADME
File metadata and controls
39 lines (31 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
4 Bit Processor
Archtecture Instruction Set (opcode, instruction name, operation, description):
(# indicates concantenation; C indicates carry bit; A and B are 4 bit registers; : indicates one machine cycle)
0000 ADD C#A <- A + B Addition
0001 SUB C#A <- A - B Subtraction
0010 INC C#A <- A + 1 Increment
0011 DEC C#A <- A - 1 Decrement
0100 NOT A <- A' Negation
0101 AND A <- A AND B Logical AND
0110 OR A <- A OR B Logical OR
0111 XOR A <- A XOR B Logical exclusive or
1000 JMPU MAH <- Mem[PC] : PC <- PC + 1 Unconditional jump
MAL <- Mem[PC] : PC <- PC + 1
PC <- MA
1001 JMPC MAH <- Mem[PC] : PC <- PC + 1 Jump if C = 0
MAL <- Mem[PC] : PC <- PC + 1
PC <- MA if C = 0
1010 SWAP A <- B : B <- A Swap registers A and B
1011 CPY B <- A Copy A contents into B
1100 WR MAH <- Mem[PC] : PC <- PC + 1 Write contents of A into memory location
MAL <- Mem[PC] : PC <- PC + 1
Mem[MA] <- A
1101 RD MAH <- Mem[PC] : PC <- PC + 1 Read contents of memory location into A
MAL <- Mem[PC] : PC <- PC + 1
A <- Mem[MA]
1110 IN MAH <- Mem[PC] : PC <- PC + 1 Read input peripheral into A
A <- InputHigh (if MA(7) = 1)
A <- InputLow (if MA(7) = 0)
1111 OUT MAH <- Mem[PC] : PC <- PC + 1 Write contents of A to output peripheral
OutputHigh <- A (if MA(7) = 1)
OutputLow <- A (if MA(7) = 0)