2014-10-17

CS CSP Binary Code for Teacup

convert the following list of decimal numbers for the Teacup image into binary code:

  • 4, 11 
  • 4, 9, 2, 1 
  • 4, 9, 2, 1 
  • 4, 11 
  • 4, 9 
  • 4, 9 
  • 5, 7 
  • 0, 17 - (17 > 15 so I have provided it -> 10001)
  • 1, 15
Here is the binary equivalents for the first 16 numbers

0000 = 0  
0001 = 1
0010 = 2
0011 = 3
0100 = 4
0101 = 5
0110 = 6
0111 = 7
1000 = 8
1001 = 9
1010 = 10
1011 = 11
1100 = 12
1101 = 13
1110 = 14
1111 = 15

Your code should start with a line number zero, followed by two zeros to indicate the beginning of the code:
000000000000

Your first line should begin with line number one, followed by the binary numbers to represent four and eleven:
000101001011

Continue through the list of decimal numbers, increment the line number by 1 until you reach the end of the list.  At the end of the list, add one more line number and indicate the end of the code with the binary equivalents of another two zeros.