Jump to content

Not sure if this is the right place - Micro-instruction code

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Dasani

Dasani

    Newbie

  • Members
  • Pip
  • 1 posts
My teacher is a terribly unhelpful teacher and will not give me any help in doing this project.

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.

#2
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Ok...post your 12-line code so I can see what this syntax is like. I know you posted the fields, but it's a little easier with a concrete example, you know?
sudo rm -rf /




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users