AMY
The future CPU of the past. An 8-bit processor designed from logic gates in Logisim by a team of three, with its own instruction set, ALU and control unit.
The name
AMY is the team's initials, and an acronym for Afkar Min Yutopia. Afkar is Arabic for thoughts, min means from, and Yutopia is a play on utopia: thoughts from utopia. It borrows from the way science fiction names its machines, JARVIS and friends.
The brief, and what was hard before building anything
The constraints were fixed: an 8-bit data path and address space, a small instruction set, fixed 8-bit instructions and four general-purpose registers. Two circuit problems had to be solved on paper first:
- Signal racing. Signals reach a destination along paths of different lengths and arrive at different times, which gives inconsistent results. The fix was temporary registers that only update on a clock edge, holding intermediate values until the next cycle.
- Bus conflicts. ROM, RAM and the ALU all want to drive the same data bus. Control gates owned by the control unit make sure only one source is ever connected at a time.
The rest of the difficulty was human. Logisim has no way to collaborate on a circuit, so the team split the CPU into components with one owner each and did version control by hand, in three stages: memory first, then routing with multiplexers and demultiplexers, then the control unit and its timing.
Architecture
Harvard, with the program in ROM and data in RAM, because separate memories made the access logic simpler and the time was short. RISC, for the same reason. And a hybrid of two textbook designs: the "basic computer" contributed the special registers (PC, IR and an address register AR), and a modern register file contributed four general-purpose registers selected through multiplexers.

Instruction format
Every instruction is two bytes. The instruction register holds a 4-bit opcode and two 2-bit register fields; the address register holds a memory address, an immediate value, or nothing. R1 to R4 are encoded 00 to 11. Four bits of opcode allow sixteen instructions.
| Opcode | Instruction | Example |
|---|---|---|
| 0000 | MOV (imm) | MOV R2, 5 |
| 0001 | MOV (reg) | MOV R3, R2 |
| 0010 | LDR | LDR R1, [add.] |
| 0011 | STR | STR [add.], R2 |
| 0100 | ADD | ADD R1, R2 |
| 0101 | SUB | SUB R2, R3 |
| 0110 | LSL | LSL R1 |
| 0111 | LSR | LSR R2 |
| 1000 | CMPgrey row | CMP R3, R1 |
| 1001 | INC | INC R3 |
| 1010 | DEC | DEC R2 |
| 1011 | JMP | JMP address |
| 1100 | JEgrey row | JE address |
| 1101 | JNEgrey row | JNE address |
| 1110 | JGgrey row | JG address |
| 1111 | JLgrey row | JL address |
The striped rows were greyed out in the report: designed into the opcode table, never built. CMP and the four conditional jumps were cut for time and left in the encoding so they could be added later. The emulator below has a tab that switches them on, so you can see what they would have unlocked.
Forty-one ticks per instruction
The control unit counts clock ticks with a 6-bit counter. Every instruction gets the same window: ticks 0 to 23 fetch from ROM, ticks 24 to 40 execute, using RAM if the instruction needs it. A gate watches for the count to reach 41 and resets the counter. Another flips the memory select line from ROM to RAM once the count passes 23. And if the instruction register reads 0xFF, the counter stops: that is the halt instruction.

A program, all the way down
Program 1 from the report loads 5 and 7, adds them into R1, and stores the result at address 20:
| Assembly | IR | AR |
|---|---|---|
| MOV R2, 5 | 0x04 | 0x05 |
| MOV R3, 7 | 0x08 | 0x07 |
| ADD R1, R2 | 0x41 | 0x00 |
| ADD R1, R3 | 0x42 | 0x00 |
| STR [20], R1 | 0x30 | 0x14 |
| HLT | 0xFF | 0x00 |
These bytes are generated by the same encoder the emulator below runs, and a test checks every one against the report's own tables. The report is honest about the limit: its second program shows a loop, and notes that without conditional jumps it would run forever.
The emulator below runs both of the report's programs and the grey-row multiply. Step through one instruction at a time and watch the registers light up bit by bit.
Try it
From the report, listing 2
ROM IR = opcode | Rx | Rx, then AR
Registers
PC
00
IR
00000000
AR
00
Flags
EQGTLT
Ticks
0
reset
RAM 10 to 1F
RAM[20], the answer
--
Runs the instruction format from the project report: a 4-bit opcode, two 2-bit register fields, and an address byte. Programs 1 and 2 are the report's own listings.