Trouble implementing F control bit in ALU

classic Classic list List threaded Threaded
6 messages Options
nNa
Reply | Threaded
Open this post in threaded view
|

Trouble implementing F control bit in ALU

nNa
Hello!

I have a lot of trouble figuring out, how to implement the F control bit in ALU, so it will AND/ADD X and Y. I figured out most of the ALU (except ZR and NG outputs), but F is a real pain to me.

Do you have any tips?

- nNa
Reply | Threaded
Open this post in threaded view
|

Re: Trouble implementing F control bit in ALU

culchie
If you made all the chips in chapter 1 then you have everything you need.
You can AND 2 16 bit inputs
You can ADD 2 16 bit inputs
You can then use the output of those as the input to
another chip you made that will output one of them
nNa
Reply | Threaded
Open this post in threaded view
|

Re: Trouble implementing F control bit in ALU

nNa
I know how to do that, but I don't know how to use F to decide if I want to ADD or AND. With nx and zx it was easy, but with F it's harder.
Reply | Threaded
Open this post in threaded view
|

Re: Trouble implementing F control bit in ALU

culchie
nNa wrote
 I don't know how to use F to decide if I want to ADD or AND
I am not sure if I understand you. If you mean that you think only AND or ADD should be carried out in the ALU, the answer is that both operations are carried out, every time.
The outputs of the AND chip and the ADD chip are then used, along with F, as the inputs of another internal chip in the ALU.
nNa
Reply | Threaded
Open this post in threaded view
|

Re: Trouble implementing F control bit in ALU

nNa
Thank you very much! I always wanted to check for F first and then AND or ADD. This helped a lot!
Reply | Threaded
Open this post in threaded view
|

Re: Trouble implementing F control bit in ALU

culchie
You're welcome :)