Commit Graph

3 Commits

Author SHA1 Message Date
Collin J. Doering b79d0b948b Fixed issue with jumps in cpu
For a jump to occur the current instruction must be a c-instruction and
the jump condition must hold true. Before this commit the former was forgotten.

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-05-24 03:29:12 -04:00
Collin J. Doering 8d3150f7e2 Fixed issue with cpu
The port assignment for the cpu_alu was incorrect. It was set to be the
output of register A but it should be either the output of register A or
inM depending on bit 'a' of the instruction. This corresponds to the
output signal of mux16_1 (which is memtoALU).

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-05-23 10:43:10 -04:00
Collin J. Doering b38cec30f0 Initial implementation of hack cpu and test bench
The test bench 'cpu_tb.vhdl' currently fails for almost all inputs. Though from
analysis of the vcd output, everything seems to be working correctly. It
seems that the compare data from the nand to tetris course for
synchronized circuits/chips does not behave nicely with this simulation
because it assumes two clock cycles is one discreet time
unit (tick-tock) whereas in this simulation every pulse of the
clock (1 ns period) acts as a single discreet time unit. This however
still needs to be investigated and also is an issue in the
implementation of 'pc_tb.vhdl'.

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-05-23 03:39:37 -04:00