1. Home
  2. Explore
  3. Computer Science
  4. Building a Simple Computer

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Building a Simple Computer

  • 47Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Registers And Addressing

What could the two 4-bit registers in the initial computer setup store, and what calculations could its ALU perform?

47 questions

  1. 1

    What could the two 4-bit registers in the initial computer setup store, and what calculations could its ALU perform?

    Model answer

    Each register could store one number, and the ALU could add or subtract the two values.

    Explanation

    For example, the setup could store 15 and 10, then calculate 15 minus 10.

  2. 2

    What does a 4-bit register contain in the described design?

    Model answer

    It contains four 1-bit registers, each storing one bit.

    Explanation

    Combining the four stored bits allows the register to hold a 4-bit value.

  3. 3

    Why was a larger main memory needed in addition to the working registers?

    Model answer

    Registers hold values being worked with immediately, while main memory provides more space to store calculation results and retrieve them later.

    Explanation

    A small set of registers is not enough for storing many values for later use.

  4. 4

    What is the basic latch used as a building block for the simulated memory, and how does it retain a bit?

    Model answer

    It is made from two NOR gates whose outputs feed back into each other, allowing the circuit to keep one bit of data in place.

    Explanation

    The feedback maintains the stored state rather than requiring the input to remain present.

  5. 5

    How many memory locations are in a 4×44\times44×4 grid, and how many address bits are needed to select one?

    Model answer

    The grid has 16 locations and requires 4 address bits to select one.

    Explanation

    Four bits can represent 16 distinct address combinations.

  6. 6

    How can a 4-bit address be divided to select a location in a 4×44\times44×4 grid?

    Model answer

    Use two bits to select the row and the other two bits to select the column.

    Explanation

    The row and column selections together identify one location in the grid.

  7. 7

    What does a 2-bit decoder produce in the described memory design?

    Model answer

    It produces four outputs, with one output indicating which of the four possible input values is selected.

    Explanation

    The four 2-bit combinations correspond to values 0, 1, 2, and 3.

  8. 8

    How can logic gates detect whether a 2-bit input represents zero, one, two, or three?

    Model answer

    Use AND gates to test the required combination of input bits, inverting a bit when the desired value requires that bit to be zero.

    Explanation

    For example, detecting zero requires both bits to be inverted before they enter the AND gate; detecting three uses both bits directly.

  9. 9

    Why would using full clocked registers for every bit of a large main memory be wasteful in the described design?

    Model answer

    Each register includes synchronization logic that would be duplicated for every memory bit, adding unnecessary circuitry and potentially slowing the design.

    Explanation

    The simpler feedback latch can store a bit without repeating all the register's clock-handling logic.

  10. 10

    How does a memory cell decide whether it has been selected in the grid?

    Model answer

    An AND gate checks whether both its row and column are active; the cell is selected only when both are on.

    Explanation

    The row and column decoders identify the cell's position, and their outputs jointly select it.

  11. 11

    Under what conditions does a selected memory cell write its input data?

    Model answer

    It writes the input data when the cell is selected and the store signal is on.

    Explanation

    The write logic requires both the row-and-column selection and the store control to be active.

  12. 12

    How does the memory cell prevent unselected cells from driving the shared output?

    Model answer

    A three-state buffer disconnects an unselected cell's output; a selected cell outputs the state of its latch.

    Explanation

    A disconnected output is neither a high nor a low logic level, so multiple unselected cells do not drive the shared line.

  13. 13

    What happens to a memory cell's output and write behavior if either its row or column input is off?

    Model answer

    The cell becomes inactive: it outputs nothing and the store signal cannot write to it.

    Explanation

    Both row and column must be active for the cell to be selected.

  14. 14

    Why can the outputs of all cells in a memory grid be joined to one line?

    Model answer

    Only the selected cell is enabled to output its data at a time, so the cells can share one output line.

    Explanation

    The three-state buffers disconnect the outputs of unselected cells.

  15. 15

    How does the latch-based memory cell behave when its data input changes but the store signal is off?

    Model answer

    Its stored value does not change; new input data is written only when the store signal is enabled for the selected cell.

    Explanation

    The input alone does not overwrite the latch.

  16. 16

    What is the role of the row and column inputs on the 16-bit memory grid when that grid is used as a component in a larger grid?

    Model answer

    They let the larger grid select that 16-bit component as one cell.

    Explanation

    The component has its own internal address, while the added row and column controls select the component itself.

  17. 17

    Why is it important that only one cell in a grid actively outputs data at a time?

    Model answer

    It allows the cells to share a single output line without competing to drive it.

    Explanation

    If multiple cells drove the line simultaneously, their different values could conflict.

  18. 18

    What are the main advantages and disadvantage of latch-based static memory described in the content?

    Model answer

    It is very fast, but its cells take up substantial physical space, so this approach is used for relatively small memories.

    Explanation

    The content contrasts latch-based memory for small capacities with denser capacitor-based memory for larger capacities.

  19. 19

    How does a capacitor represent a bit in dynamic memory?

    Model answer

    A charged capacitor represents one, and an uncharged capacitor represents zero.

    Explanation

    The stored information is whether the capacitor holds electrical charge.

  20. 20

    What happens to the stored bit when capacitor memory is read, according to the content?

    Model answer

    Reading discharges the capacitor, so the stored information is lost unless it is rewritten.

    Explanation

    This makes reading the data destructive in the described capacitor-based memory.

  21. 21

    Why must dynamic memory be refreshed?

    Model answer

    Its capacitor charge leaks away over time, and reading also discharges it, so circuitry must repeatedly read and rewrite the contents.

    Explanation

    Refreshing restores the charge before the stored information disappears.

  22. 22

    Why can capacitor-based memory be more compact than latch-based memory?

    Model answer

    A bit can be stored using just one capacitor and one transistor to enable or disable the output.

    Explanation

    This uses fewer components per bit than the latch-based approach described.

  23. 23

    What is the difference between static and dynamic memory in the described terminology?

    Model answer

    Latch-based memory is called static memory, while capacitor-based memory that requires constant refreshing is called dynamic memory.

    Explanation

    The distinction is tied to the storage mechanism and, for dynamic memory, its need for refresh.

  24. 24

    Why are both static and dynamic memory described as volatile?

    Model answer

    Both require a constant power source; without power, their data is lost.

    Explanation

    Volatile memory does not preserve its contents after power is removed.

  25. 25

    How can a spinning magnetic disk retain data when power is off?

    Model answer

    It stores data long-term by changing the magnetic polarity of tiny regions on the disk.

    Explanation

    This makes it a persistent storage medium rather than volatile memory.

  26. 26

    How is the 256-bit memory built from 16-bit cells organized and addressed?

    Model answer

    It is a 4×44\times44×4 grid of 16-bit cells, selected using 8 address bits: one 4-bit portion selects a cell in the grid, and the other 4 bits select a bit within that cell.

    Explanation

    The two levels of 4-bit selection address 16×16=25616\times16=25616×16=256 individual bits.

  27. 27

    How does the 256-bit memory design become a 256-byte memory?

    Model answer

    Eight copies of the 256-bit memory are used in parallel, providing 8 bits per address, or 256 bytes total.

    Explanation

    A byte contains 8 bits, so eight parallel bit-wide memories provide byte-wide data.

  28. 28

    How many address bits are needed to select among 256 byte locations, and how wide is the data input and output?

    Model answer

    An 8-bit address selects among 256 locations, and the data input and output are each 8 bits wide.

    Explanation

    Eight address bits represent 256 distinct addresses; each location holds one byte.

  29. 29

    How does the memory preserve different values at different addresses?

    Model answer

    Each address selects its own stored location, so writing to one address does not overwrite the value at another address.

    Explanation

    Returning to an earlier address retrieves the value previously stored there unless it has been overwritten.

  30. 30

    In the nested memory design, what is the role of the address bits at each selection level?

    Model answer

    Higher-level address bits select one of the larger memory cells, while lower-level bits select a location inside that cell.

    Explanation

    Hierarchical selection combines multiple smaller address decoders to reach an individual bit or byte.

  31. 31

    Why can the simulated memory show arbitrary values before locations have been initialized?

    Model answer

    The initial states of the latches are random, so uninitialized locations can contain arbitrary values.

    Explanation

    Writing a value to a location establishes a known stored value there.

  32. 32

    What does random access mean for the described RAM, and how does it contrast with a hard disk?

    Model answer

    RAM takes the same amount of time to access any address, whereas a hard disk's access time can vary because its disk and arm must physically move.

    Explanation

    The order or physical location of a RAM request does not affect its access time in the described comparison.

  33. 33

    What kinds of memory commonly make up the computer memory arrangement described?

    Model answer

    Computers commonly have a large amount of relatively slow dynamic RAM and a smaller amount of very fast static RAM used as cache near the CPU.

    Explanation

    The cache is smaller but faster, while main RAM provides greater capacity.

  34. 34

    What happens when the CPU requests data that is already in the cache?

    Model answer

    The computer can retrieve it from the cache without fetching it from slower main RAM.

    Explanation

    Checking the cache first can avoid a longer trip to main memory.

  35. 35

    What happens when requested data is not already in the cache?

    Model answer

    The computer fetches it from main RAM and brings surrounding data into the cache as well.

    Explanation

    Loading nearby data anticipates that a later request may use a nearby address.

  36. 36

    Why can programmers care about the order in which data is requested even though RAM offers random access?

    Model answer

    Nearby requests may be served from cache after surrounding data has been loaded, avoiding slower trips to main RAM.

    Explanation

    Access order can affect cache hits even when RAM itself gives equal-time access to its addresses.

  37. 37

    What problem can occur if an asynchronous RAM's store signal is on while its address is changing?

    Model answer

    The RAM may write data to unintended addresses because it can respond to the changing address while store is active.

    Explanation

    Without clock synchronization, address changes and writes must be carefully coordinated.

  38. 38

    When does the described clocked register accept new input data?

    Model answer

    It accepts new data only on the clock's rising edge, when the signal changes from low to high.

    Explanation

    Changing the inputs while the clock is already high or low does not update the register.

  39. 39

    How was the first synchronized RAM design connected to its registers?

    Model answer

    The outputs of clocked registers for the address and data were connected to the RAM inputs, with a store signal controlling writing.

    Explanation

    The registers made the RAM's address and data change in step with the clock.

  40. 40

    Why was the data register enabled only when the store signal was on, while the address register was always enabled?

    Model answer

    Data needs to be captured only for a write, but the address can be updated whether or not a write is requested.

    Explanation

    The design gates data-register updates with store while allowing address changes at each clock edge.

  41. 41

    Why might the initial register-based synchronization approach be risky in real hardware?

    Model answer

    Signals take time to settle, so the store signal could be active before the address-register output has stabilized, causing an incorrect write.

    Explanation

    The simulation assumes signals arrive together, but real circuits have propagation delays.

  42. 42

    What is one proposed way to reduce the real-hardware timing risk in the register-based design?

    Model answer

    Register the store signal and add logic to delay it by one clock cycle so the address has time to settle.

    Explanation

    Delaying the write control gives the address signal additional time to stabilize.

  43. 43

    Why was the address input eventually connected directly to RAM rather than only through an address register?

    Model answer

    A direct connection lets RAM output the value at the latest address immediately, without waiting for another clock pulse.

    Explanation

    This makes reads respond more quickly to address changes.

  44. 44

    How does the modified design prevent a direct address change from causing an unintended write?

    Model answer

    It allows writing only when store is on and the current input address matches the clock-registered address.

    Explanation

    The address comparison gates the store signal, so a changed address cannot be written until it matches the registered one.

  45. 45

    How is equality between two 8-bit addresses tested in the described circuit?

    Model answer

    Each pair of corresponding bits is compared with an XNOR gate, and AND gates combine the results so the output is high only if every pair matches.

    Explanation

    XNOR is high when its two input bits are equal; the combined result is high only when all eight comparisons agree.

  46. 46

    In the modified synchronized RAM, what must be true for a write to occur?

    Model answer

    The store signal must be on, the input address must match the registered address, and the clocked write operation must take place.

    Explanation

    The address comparison prevents writes to changing addresses, while the register synchronizes the write with the clock.

  47. 47

    What should happen if the store signal is off when the clock is pulsed, or if the store signal changes without a clock pulse?

    Model answer

    The memory should remain unchanged in either case.

    Explanation

    A write requires the appropriate store condition and clock-synchronized operation.

1 of 47
Question 1 of 47

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent