macgradywk
Junior Member level 2
Design a 8 bit processor with the following specifications1:
1. The processor has seven 8-bit registers A, B, C, D, E, H and L.
2. It connects with an external memory containing 32 8-bit words. The memory has a
tristate output with active low signals rd and wr.
3. It has instructions MOV, LDA, STA, ADD, SUB NOP and HLT. It can also add or
subtract data directly from memory.
4. The op-codes for the instructions are defined as follows. The registers A, B, C, D, H
and L are coded as 111, 000, 001, 010, 011, 100 and 101 respectively. The letter M
always refers to the contents of the memory address in the least significant 5 bits of
the L register2. The opcodes may then be described as follows:
01 d2d1d0 s2s1s0 : MOV r1, r2 (copy reg s2s1s0 to register d2d1d0)
01 110 s2s1s0 : MOV M, r (copy reg s2s1s0 to memory)
01 d2d1d0 110 : MOV r, M (copy memory contents to register d2d1d0)
01 110 110 : HLT (halt the processor)
10 000 s2s1s0 : ADD r (add reg s2s1s0 to register A)
10 000 110 : ADD M (add memory contents to register A)
10 010 s2s1s0 : SUB r (subtract reg s2s1s0 from reg A)
10 010 110 : SUB M (subtract memory contents from register A)
11 1a4a3 a2a1a0 : STA addr (store A to memory address a4a3a2a1a0)
00 1a4a3 a2a1a0 : LDA addr (load A from address a4a3a2a1a0)
00 000 000 : NOP (do not do anything)
how to do that?
1. The processor has seven 8-bit registers A, B, C, D, E, H and L.
2. It connects with an external memory containing 32 8-bit words. The memory has a
tristate output with active low signals rd and wr.
3. It has instructions MOV, LDA, STA, ADD, SUB NOP and HLT. It can also add or
subtract data directly from memory.
4. The op-codes for the instructions are defined as follows. The registers A, B, C, D, H
and L are coded as 111, 000, 001, 010, 011, 100 and 101 respectively. The letter M
always refers to the contents of the memory address in the least significant 5 bits of
the L register2. The opcodes may then be described as follows:
01 d2d1d0 s2s1s0 : MOV r1, r2 (copy reg s2s1s0 to register d2d1d0)
01 110 s2s1s0 : MOV M, r (copy reg s2s1s0 to memory)
01 d2d1d0 110 : MOV r, M (copy memory contents to register d2d1d0)
01 110 110 : HLT (halt the processor)
10 000 s2s1s0 : ADD r (add reg s2s1s0 to register A)
10 000 110 : ADD M (add memory contents to register A)
10 010 s2s1s0 : SUB r (subtract reg s2s1s0 from reg A)
10 010 110 : SUB M (subtract memory contents from register A)
11 1a4a3 a2a1a0 : STA addr (store A to memory address a4a3a2a1a0)
00 1a4a3 a2a1a0 : LDA addr (load A from address a4a3a2a1a0)
00 000 000 : NOP (do not do anything)
how to do that?