Ten storage jobs on a chip, and six kinds of storage. Give each job the kind that fits it.
Hardware context: The memories of ap_soc side by side: a ROM, a register file of flip-flops and the on-chip SRAM. Choosing memories for a chip and sizing a boot ROM
A design team lists what the chip must store. For each job, enter the code of the kind of memory that fits best. Decide by three questions: must the content survive with the power off, must a program be able to change it, and how large is it.
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
| Code | Kind of memory |
|---|---|
| 1 | ROM: fixed when the chip is made |
| 2 | SRAM on the chip |
| 3 | Flash |
| 4 | One-time programmable bits |
| 5 | DRAM, in chips of its own |
| 6 | A register file or plain flip-flops |
| Entry | Your decision |
|---|---|
| FIRST_CODE | The first instructions after a reset. They never change for the life of the chip. |
| STACK | The working data of a program on a small chip: 64 KiB, written all the time. |
| PRODUCT_CODE | The program of the product. It must survive with the power off, and the maker updates it twice a year. |
| DEVICE_KEY | A secret key of 256 bits. The factory writes it once, and nothing may ever change it. |
| PHONE_MEMORY | Four gigabytes of working memory for a phone. |
| CPU_REGISTERS | Thirty-two words inside the processor. Two are read and one is written in every clock cycle. |
| CACHE_DATA | The 32 KiB of copies that a cache keeps beside the processor. |
| VERSION_FLOOR | A count of eight bits that may only go up, and must survive with the power off. |
| FAULT_LOG | A log of the last hundred faults. It must survive a power cut, and the service desk erases it. |
| SMALL_QUEUE | Four bytes that a serial port holds between the wire and the bus. |
| WORKING_MEMORY | A design needs SIZE_KIB kibibytes of working memory. Exercise rule of this worksheet: up to 1024 KiB fits on the chip as SRAM, and anything larger is DRAM. Enter the code. |
Examples
Example 1
FIRST CODE- Input
The first instructions after a reset. They never change for the life of the chip.
- Output
matches = 1
Fixed for ever, and needed before anything else works: a ROM, code 1.
Example 2
STACK- Input
The working data of a program on a small chip: 64 KiB, written all the time.
- Output
matches = 1
Read and written at full speed, and it may be lost with the power: SRAM on the chip, code 2.
Example 3
PRODUCT CODE- Input
The program of the product. It must survive with the power off, and the maker updates it twice a year.
- Output
matches = 1
It must survive and be changed now and then: flash, code 3.
Constraints and Contract
- Keep the parameter and named constants. Use the numeric codes and units on this page.
- For WORKING_MEMORY, enter a constant expression using SIZE_KIB. Only this entry changes with the parameter. The supported integer range is 64 through 4096, inclusive.
Hints
Hint 1
Ask first whether the content must still be there after the power was off.
Hint 2
Never, once, now and then, or in every cycle.
Hint 3
A few bytes, some kibibytes, or gigabytes.
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 2 problems on this path