How many pulses are needed to change the contents of a 8-bit up counter from…
2005
How many pulses are needed to change the contents of a 8-bit up counter from 10101100 to 00100111 (rightmost bit is the LSB)?
- A.
134
- B.
133
- C.
124
- D.
123
Attempted by 149 students.
Show answer & explanation
Correct answer: D
Convert both binary numbers to decimal: 10101100₂ = 172; 00100111₂ = 39.
Method 1 (modular arithmetic): compute (target − start) mod 256 because this is an 8-bit up counter.
Calculate (39 − 172) mod 256 = (−133) mod 256 = 123.
Method 2 (count-to-end then wrap): pulses to reach 255 from 172 = 255 − 172 = 83; one more pulse wraps to 0 = +1; then advance 39 steps to reach 39 = +39. Total = 83 + 1 + 39 = 123.
Answer: 123 pulses.
A video solution is available for this question — log in and enroll to watch it.