I am working with a Mac0 computer and I am having trouble coming up with an algorithm here.
We have the following registers to play with:
t1, t2, t3
These registers hold values:
gr0, gr1, gr2, gr3
I need to come up with a micro-instruction that adds two of the gr registers in 5 lines of micro-code.
The code has the following format:
: c i a s c b a : o n m a h mm e c b a : n t u l f ba rw n c b a : d r x u t rr dr c c b a addr4 :--- -- - -- -- -- -- - ---- ---- ---- -------- 000 00 0 00 00 00 00 0 0000 0000 0000 00000000
The ALU has capabilites of adding, AND'ing, OR'ing, and NOT'ing. The ALU can operate on any register with the given capabilities. We must take values using the A-bus and B-bus and can put values back into the different registers with the C-bus. The 4-bit a, b and c are to specify which registers should be put on the bus (ie: 0001 would choose what's in register 1). MBR, MAR, and AMUX are not particularly important here--I just need to find a very quick algorithm to add two GR registers coming from the a and b bus.
A macro-instruction comes in saying to ADD GR[0] and GR[1] meaning:
GR[0] + GR[1] and put this value back into GR[0]
This is a simple task to do in like 12 or so lines of code but I can't seem to break it down into 5. I desperately need some hints here...anything will help.


Sign In
Create Account

Back to top









