C8 Computer organization · Practice
Pointers and memory-mapped registers,
Problems dealt one at a time, with new numbers every time. The kinds you miss come back more often, and you can keep going as long as you like.
Check
An 8-bit LED register holds 0x29, with LED 1 off. What value turns LED 1 on and leaves the others as they are?
Check
What 8-bit mask do you AND a register with to clear bit 2 and keep the others?
Check
The LEDs already show a pattern. Turn on LED 2 (bit 2) without changing any of the others. Read the pattern from the LED register; don't write it in.
RISC-V RV32IM (base integer plus multiply and divide). End your program with ebreak. Tab indents; press Esc and then Tab to move on.
Check
Light each LED whose switch is off, and turn off each LED whose switch is on. (Read the switches once, then stop.)
RISC-V RV32IM (base integer plus multiply and divide). End your program with ebreak. Tab indents; press Esc and then Tab to move on.
Check
The switch register reads 0x5B. What is (*switches >> 0) & 1?
Check
A register holds 3C. Set its bits 7:4 to 2 and leave the others alone.
(a)
What does it hold afterward?
(b)
What's left after the AND with ~0xF0, before the OR?
Check
Toggle bit a1 of a0 and put the result in a2.
RISC-V RV32IM (base integer plus multiply and divide). End your program with ebreak. Tab indents; press Esc and then Tab to move on.
Check
Register 0x29; set bit 1. New value?
Check
8-bit mask to clear bit 2?
Check
The LEDs show a pattern. Flip LED 2 (on to off, or off to on), leaving the rest.
RISC-V RV32IM (base integer plus multiply and divide). End your program with ebreak. Tab indents; press Esc and then Tab to move on.
A kind of problem counts as solid once you've got it right on the first try twice in a row. Back to the lesson · Practice every topic in C8