B25EXCLUSIVE
The task
P0 and P1 read two square waves. Light the LED on P2 while exactly one of them is high.
When both are high or both are low, keep it dark.
The board
- Sources
- V1 5 V square at 125 Hz and V2 5 V square at 200 Hz
- Resistors
- R1 330 Ω
- LEDs
- D1 yellow
- Probes
- CH1, CH2, and CH3
Key idea
MOV B, A keeps the first reading while you take the second.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
The difference of two readings is 0 only when they match.
Hint 2Show
SUB B leaves 1 or minus 1 when they differ, and either one lights the LED.
Solution
Reveal the Full SolutionThe complete program for EXCLUSIVE. Open it only when you want the answer.
The reference program
The game's own solution. It passes every test and scores exactly par on every benchmark.
The LED lights while the inputs differ.
u1SC-2 standard
IN P0
MOV B, A
IN P1
SUB B
OUT P2- CYCLES
- 400
- at par
- ENERGY
- 800
- at par
- NODES
- 1
- at par
- INSTRUCTIONS
- 5
- at par