Help needed with PC - not sure where to get output from?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Help needed with PC - not sure where to get output from?

dhruvkapur91
I've been using a Register, an Inc16 and a Mux8Way16 to implement PC.

For me, my circuit looked like:

    Register(in = outCopy, load = true, out = outDelayed);
    Inc16(in = outDelayed, out = incOutDelayed);
    Mux8Way16(a = outDelayed, b = false, c = incOutDelayed, d = outDelayed, e = in, f = outDelayed, g = outDelayed, h = outDelayed, sel[2] = load, sel[1] = inc, sel[0] = reset, out = out, out = outCopy);

I guess it gets the priority order wrong, but that's okay and something I can fix later.

When I put this in hardware simulator and run test, it fails on time 1+ wherein it sets inc = 1, and output immediately changes to 1 while in test case it stays at 0 and changes in next cycle.
This problem is probably solved if I instead make register's out as out and not mux. I'm not sure if I get why.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help needed with PC - not sure where to get output from?

cadet1620
Administrator
dhruvkapur91 wrote
When I put this in hardware simulator and run test, it fails on time 1+ wherein it sets inc = 1, and output immediately changes to 1 while in test case it stays at 0 and changes in next cycle.
This problem is probably solved if I instead make register's out as out and not mux. I'm not sure if I get why.
You are correct.  The Register's 'out' needs to be the PC's out.

Remember the structure of the Bit. The DFF's 'out' is the bit's 'out', and it is also fed back to the DFF's 'in' through the load mux.

In your PC, by tying the Register's 'load' input true, you have effectively turned the Register into a DFF16.

You PC's schematic should look amazingly similar to the Bit's.  (Mux -> Mux8Way16, DFF -> DFF16 [Register], add the Inc16)

--Mark
Loading...