My blog has been moved to ariya.ofilabs.com.

Friday, November 25, 2005

Seven-Segment Problem

After too long working on a prototype board, I had an idea to invent this question.

.

You have a 7-segment display. A byte is sent to the display, 7 bits are used to switch on (if the bit is set) or switch off (if the bit is reset) the segments. One bit in this byte is not used and always zero.

Values in the byte which correspond to decimal number (0 to 9) shown in the display are summarized as follows:

  "0"    0xE7 
  "1"    0x22 
  "2"    0xAD 
  "3"    0xAB 
  "4"    0x6A 
  "5"    0xCB 
  "6"    0xCF 
  "7"    0xA2 
  "8"    0xEF 
  "9"    0xEB 

Find out what value you must send so that the display shows "E".

In an interview, see how fast your candidate can get the answer (of course, you can replace "E" with another letter). Also, if he or she spends too much time studying number "8", time to try another candidate...

4 comments:

Anonymous said...

0xCD?

Ruurd said...

'8' and (not '1'))

Budi Rahardjo said...

Whatever produces "8" XOR with whatever produces "1"? (I am kind of lazy thinking right now. Ha ha ha.)

Unknown said...

Isn't it just the value of 8 minus the value of 1?

EF - 22 = CD