Choose the protection of six memories of a chip, and count what each choice stores.
Hardware context: A memory of four words, each 8 data bits with one even-parity bit beside them, and an error injector, as test code. Parity protection of caches and other memories that hold copies
A team protects its memories by one rule. A memory whose contents are also kept somewhere else needs only to notice an error: it gets parity, one bit for each byte, and fetches the data again. A memory that holds the only copy must repair an error: it gets SEC-DED. A memory in which a wrong bit does no harm gets nothing. Enter the choices as numbers: 0 for nothing, 1 for parity, 2 for SEC-DED.
This worksheet uses named constants. The first three entries show how to record your decisions.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
Enter every answer as a whole number. For a yes or no question, enter 1 for yes and 0 for no.
| Entry | Your decision |
|---|---|
| INSTRUCTION_CACHE | An instruction cache. Every block in it is a copy of the program in flash. Which protection? |
| MAIN_SRAM | The SRAM with the variables of the program. Which protection? |
| PARITY_WORD_BITS | How many bits does a memory with parity store for a word of 32 bits? |
| SECDED_WORD_BITS | How many bits does a memory with SEC-DED store for a word of 32 bits? |
| TLB_ENTRIES | A TLB. Its entries are copies of page-table entries in memory. Which protection? |
| WRITE_BACK_CACHE | A data cache that keeps written data until the block leaves. That data is not in memory yet. Which protection? |
| FRAME_OF_DEMO | A buffer of pixels for a demo screen. One wrong pixel for one frame is accepted. Which protection? |
| PARITY_SEES_TWO | Two bits of one byte flip. Does parity notice? |
| SECDED_SEES_TWO | Two bits of one word flip. Does SEC-DED notice? |
| SECDED_BITS_64 | How many check bits does SEC-DED need for a word of 64 bits? |
| SCRUB_PASS_MS | A scrubber repairs one word every millisecond. The memory has 200 words. How many milliseconds does one pass take? |
| SECDED_CHECK_BITS | A word has DATA_BITS data bits, a power of two. Give the number of check bits of a SEC-DED code for it. |
Examples
Example 1
INSTRUCTION CACHE- Input
An instruction cache. Every block in it is a copy of the program in flash. Which protection?
- Output
matches = 1
The flash still has the block. Notice the error, and fetch the block again.
Example 2
MAIN SRAM- Input
The SRAM with the variables of the program. Which protection?
- Output
matches = 1
It is the only copy. An error must be repaired.
Example 3
PARITY WORD BITS- Input
How many bits does a memory with parity store for a word of 32 bits?
- Output
matches = 1
One parity bit for each of the four bytes.
Constraints and Contract
- Keep the parameter and named constants. Use the numeric codes and units on this page.
- For SECDED_CHECK_BITS, enter a constant expression using DATA_BITS. Only this entry changes with the parameter. The supported integer range is 4 through 128, inclusive.
Hints
Hint 1
If the data can be fetched again, noticing is enough: parity.
Hint 2
Then an error must be repaired: SEC-DED.
Hint 3
Parity adds one bit for each byte. SEC-DED adds the position bits and one overall parity.
What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.
12 checks on Icarus Verilog · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain your source only; samples require the simulation service. A passing result establishes the tested cases, not a proof for all possible inputs.
See all 3 problems on this path