Learn
Practice
Power-Up Defaults in Binary and Hex
A small LED controller chip must present fixed configuration values the moment power arrives: no processor loads them; they are wire bundles permanently connected to constants. Real datasheets mix binary, decimal, and hex notation, so this one does too. Your job is to convert each value and write it as a literal of the requested base and width.
Interface
| Port | Direction | Type | Description |
|---|---|---|---|
pattern_o | out | 4-bit vector | Startup pattern for the 4-LED bar |
addr_o | out | 8-bit vector | The controller's bus address |
mask_o | out | 8-bit vector | Channel enable mask |
max_level_o | out | 4-bit vector | Highest brightness level the chip supports |
Behavior
Each row takes a different route between number bases:
| Port | Width | Datasheet value | Write it in | Conversion |
|---|---|---|---|---|
pattern_o | 4 bits | hex C (two leftmost LEDs lit) | binary | hex to binary |
addr_o | 8 bits | decimal 90 | hex | decimal to hex |
mask_o | 8 bits | binary 0101 0101 (even-numbered channels enabled) | hex | binary to hex |
max_level_o | 4 bits | decimal 13 | binary | decimal to binary |
The testbench reads all four outputs once and compares each against its decimal value. The requested spelling is still part of the specification: use binary where the table says binary and hex where it says hex.
Constraints
STRUCTURE: drive every output with a single assignment outside a procedural block and a literal: no operators, no conversion functions.
- Every literal's width must match its port exactly
Click Run to execute your code. Output will appear here.