-
1CPU instruction set
Instruction is 16 bits wide.
6 bits opcode.
Address is up to 10 bit (1kb),
Immediate Data is 8 bit.
There are 14 instructions:
_______________________________________
adddres/data CPU opcode
10 bits 6 bits Hex
0 00 h - Noop
0 01 h - clear Accumulator A (A=0)
...address 02 h - jump conditional if overflow
...address 03 h - jump unconditional
...#data.. 0C h - add immediate data to A
0 0D h - add value of A to A (A=A*2)
....address 0E h - add value from SRAM to A
.... port.. 0F h - add value from input port to A
....#data.. 14 h - subtract immediate data from A
0 15 h - subtract value of A from A
....address 16 h - subtract value from SRAM to A
.....port.. 17 h - subtract value from input port from
....address 1D h - store value A to SRAM by address
.....port.. 25 h - write value A to output portNotes:
There is no Load instruction. But one can use Clear accumulator, followed by add instruction to load value.
There is only one flag Carry (overflow). But it can be used to check different conditions, i.e. not zero, lesser than, and so on.
ALU is 8 bits wide. But multi-byte numbers can be added or subtracted in several steps, using carry flag.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.