Follow bytes of flash through erases and writes, count the erases of two update schemes, and burn one-time bits.
Hardware context: One erase block of a flash memory and eight one-time programmable bits, as test code. Storing settings, counts and keys that must survive with the power off
A flash block holds four bytes. An erase sets every bit of the block to 1. A write can only clear bits: the byte becomes the AND of what it held and what was written. One-time bits go the other way: a burn can only set bits, and nothing clears them.
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 each byte as a number. A hexadecimal literal such as 8'h3c is allowed. Enter counts as whole numbers.
| Entry | Your decision |
|---|---|
| AFTER_ERASE | What does a byte hold just after its block was erased? |
| FIRST_WRITE | An erased byte is written with 8'h5a. What does it hold? |
| SECOND_WRITE | That byte, now 8'h5a, is written with 8'ha5 with no erase. What does it hold? |
| OVERWRITE | A byte holds 8'hf0. It is written with 8'h3c with no erase. What does it hold? |
| SAME_AGAIN | A byte holds 8'h3c. The same value 8'h3c is written again. What does it hold? |
| SET_A_BIT | A byte holds 8'h0f. A program writes 8'hff to set the high bits. What does it hold? |
| ERASES_SAME_BYTE | A count is updated 12 times, always in byte 0, with an erase before each update. How many erases? |
| ERASES_NEXT_FREE | The same 12 updates go to the next free byte of the block of four. The block is erased only when it is full, and once before the first update. How many erases? |
| FUSES_AFTER | Eight one-time bits hold 8'b0000_0101. A program burns 8'b0000_0110. What do they hold? |
| FLOOR_AFTER | A version floor is the number of one-time bits that are 1. What is it after that burn? |
| ERASES_VARIANT | A count is updated UPDATES times with the next-free-byte scheme, in a block of four bytes, with one erase before the first update. Give the number of erases. |
Examples
Example 1
AFTER ERASE- Input
What does a byte hold just after its block was erased?
- Output
matches = 1
An erase sets all eight bits: ff, which is 255.
Example 2
FIRST WRITE- Input
An erased byte is written with 8'h5a. What does it hold?
- Output
matches = 1
ff AND 5a is 5a, which is 90.
Example 3
SECOND WRITE- Input
That byte, now 8'h5a, is written with 8'ha5 with no erase. What does it hold?
- Output
matches = 1
0101 1010 AND 1010 0101 share no 1, so the byte is 00.
Constraints and Contract
- Keep the parameter and named constants. Use the numeric codes and units on this page.
- For ERASES_VARIANT, enter a constant expression using UPDATES. Only this entry changes with the parameter. The supported integer range is 1 through 17, inclusive.
Hints
Hint 1
A write to flash clears bits. A burn of one-time bits sets bits. Neither can go back.
Hint 2
Write both bytes in binary, one under the other, before you combine them.
Hint 3
Ask how many updates one erase can serve.
What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.
11 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 1 problem on this path