Nand2tetris problem help

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

Nand2tetris problem help

chrissowden14
/**
 * FSM AB go to 00 when x is 0,
 * when x is 1 steps to 01, then 11, then 01, repeating
 */

CHIP ABxFSM2 {
    IN x;
    OUT out[2];

    PARTS:
   
       
}


So I am having a problem with this. I can't seem to get it to work. That is the HDL file.


ABxFSM2.tst
ABxFSM2.hdl
ABxFSM2.cmpp file
Reply | Threaded
Open this post in threaded view
|

Re: Nand2tetris problem help

cadet1620
Administrator
This appears to be 2-bit finite state machine.

You can implement it using 2 DFF parts.

Like the Bit, the DFF outputs connect to the chip's outputs, and a combinational circuit with x and the two DFF outputs control what the next DFF inputs are.

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

Re: Nand2tetris problem help

chrissowden14
I did that .... I did two DFF but it's not working. I have tried a few different ways.. not sure why it's not working
Reply | Threaded
Open this post in threaded view
|

Re: Nand2tetris problem help

cadet1620
Administrator
Since this is not a nand2tetris part, I have no idea what your instructor's goals are for assigning this part.  I cannot give you specific implementation help.

Simple things to do for a FSM are to look at the sequence that it counts and see if there are simplifications to the general FSM implementation.
Do the bits depend on each other or are they independent?
Are any bits only dependent on input bits?

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

Re: Nand2tetris problem help

chrissowden14
I attached the hdl , tst, cmd... files.... the instructor did not say... i will post what I did when I get to my computer.

Thanks for helping!!
Reply | Threaded
Open this post in threaded view
|

Re: Nand2tetris problem help

chrissowden14
This is what I just tried...

/**
 * FSM AB go to 00 when x is 0,
 * when x is 1 steps to 01, then 11, then 01, repeating
 */

CHIP ABxFSM2 {
    IN x;
    OUT out[2];

    PARTS:
        //Ain
        Not(in = bOut, out = bNot);
        And (a=x, b=bNot, out=aIn);
       
   
        //A
        DFF(in = x, out = out[1]);
       
        //B
        DFF(in = false, out = bOut, out = out[0]);
       
   
       
}