Load and In

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

Load and In

tdr
Hi,

So i have a small problem understanding the difference between input and load in chapter 3.What i read is that load enables some kind of command of writing/reading but i seem to miss something here because i don't know how this works.

Like the register for ex. It has an Input and a Load.What is the difference between this 2?
Reply | Threaded
Open this post in threaded view
|

Re: Load and In

xedover
Your data that you want to store, or remember, is coming "in" (input).
Think of "load" as a traffic cop, or gatekeeper, either allowing the data to come in, or denying it.

Say you want to store a binary number 6 (00000110) in your memory register.
You would input that value and then when your control logic has determined that its ready, the "load" flag is set to allow that data to be "input"/stored.

is that enough to help?
tdr
Reply | Threaded
Open this post in threaded view
|

Re: Load and In

tdr
it looks like it is similar with the clock.are they one and the same?
Reply | Threaded
Open this post in threaded view
|

Re: Load and In

ivant
tdr wrote
it looks like it is similar with the clock.are they one and the same?
Think of "load" this way: the "in" bus always has some value. If you just want to read the data stored in the Bit/Register/Memory register, this value must be ignored. You do that by making sure that "load" is 0.

When you want to update the value, you make load 1.

The clock is a synchronization mechanism. In the real world chips, things don't happen at the same time. The clock should be slow enough so that the slowest parts of the chip can get their outputs settled, so they can be used by the next iteration.

For example, consider if the HACK CPU needs to store certain value in a specific address in the RAM. It has to produce the value on its outM[16] output, the address on it's addressM[15] output, and it needs to set writeM to 1. Without the clock, as soon as the writeM is set to 1, the RAM will start writing whatever is in outM on whatever address is specified on addressM. Not a good way to do computing.
Reply | Threaded
Open this post in threaded view
|

Re: Load and In

xedover
In reply to this post by tdr
Ben Eater has a series of short videos talking about this same thing with registers and the data bus. Watch these (starting with this first one), and see if that helps your understanding: https://www.youtube.com/watch?v=QzWW-CBugZo
tdr
Reply | Threaded
Open this post in threaded view
|

Re: Load and In

tdr
guys, thanks for your help, i read what you wrote and i watched the videos. I think i got it.

What i understand is that load is a control bit.It basically enables or blocks the writing of a new input on the register.Now what i further understand is that load is enabled by the clock.

So when the clock is 1 load is also 1 and so it enables new data to enter the register.When the clock is 0 the load is also 0 and so it blocks new data from entering the register.Basically the register is closed to new data.

Is this correct?
Reply | Threaded
Open this post in threaded view
|

Re: Load and In

ivant
tdr wrote
guys, thanks for your help, i read what you wrote and i watched the videos. I think i got it.

What i understand is that load is a control bit.It basically enables or blocks the writing of a new input on the register.Now what i further understand is that load is enabled by the clock.

So when the clock is 1 load is also 1 and so it enables new data to enter the register.When the clock is 0 the load is also 0 and so it blocks new data from entering the register.Basically the register is closed to new data.

Is this correct?
Yes, that is correct.

(In the real world, there are several types of latches and flip-flops, with various characteristics, like edge-triggered flip-flops. You don't need these for the HACK machine, but you may want to read about them afterwards.)