Close

command set architecture and mechanical layout

A project log for 4 bit computer built from discrete transistors

This project is an attempt to teach myself about the inner workings of computers. Naturally I started from the bottom up.

zaphodzaphod 04/23/2015 at 20:490 Comments

as I mentioned in my last project log I have changed the command set. I won't bother reproducing the old command set here, however this is the new command set:

mnemonicbinary (decimal)description
LOAD:
following commands load the indicated unit with the value asserted to the main bus
@0000 (0)
B0001 (1)
C0010 (2)
PC0011 (3)
RAM0100 (4)loads address pointed to by @ register
TOGGLE BUS:following commands enable/disable the indicated unit's output bus
ALU0101 (5)
ROM0110 (6)
RAM0111 (7)asserts value located in address indicated by @ register
MISC:miscellaneous commands
TOGGLE ADD/SUB1000 (8)toggles the ALU between addition and subtraction
LOAD PC IF B==C1001 (9)loads the PC with the value asserted to the main bus if the values in registers B and C are equal

as mentioned in previous posts the clock is split up into two cycles, a PC CLK and a LOAD CLK. a full clock cycle would go something like this:

rising edge of PC CLK:

new command/value is asserted to the ROM out bus

rising edge of LOAD CLK:

command is carried out

there are two major types of command, LOAD and TOGGLE BUS.

LOAD:

the load pin selected by the command is toggled high for the entire LOAD CLK

TOGGLE BUS:

the write enable for the bus indicated by the command is toggled on the rising edge of LOAD CLK. if a write enablle was already high, it would be toggled low, if it was already low it would be toggled high.

example:

if we wanted to write the out put of the ALU to RAM first the command TOGGLE BUS ALU would be executed, this command would would write the output of the ALU to the main bus. then the PC would increment loading the next command; LOAD RAM. this command would toggle the load pin on the RAM high for the entire LOAD CLK.

a side effect of this new command set architecture is that values from ROM will be available one clock cycle after the TOGGLE BUS ROM command. for example to get a value from ROM to RAM one would first have to execute a TOGGLE BUS ROM command opening the ROM BUS, the next instruction would contain the value to be loaded to RAM, as the value and instruction are contained in the same ROM memory address.

mechanical layout:

as you may have noticed the mechanical layout has changed, this is to cope with the increase in the number of boards required for the computer. all nine logic boards are mounted on a plywood frame that is about the size of a briefcase.

Discussions