Assignment 2 6.5 Review Questions page 231




1) Convert the following binary numbers to decimal.


a)

11111

32+16+8+4+2+1

16+8+4+2+1

=31

b)

101101

64+32+16+8+4+2+1

32+0+8+4+0+1

=45

c)

1100011

128+64+32+16+8+4+2+1

64+32+0+0+0+2+1

=99



Convert the following decimal numbers to binary.


a)

47

47-32=15

15-8

7-4

3-2

1

32+16+8+4+2+1

1+0+1+1+1+1

32+8+4+2+1=47

b)

358-256=102

0

102-64=38

38-32=6

0

6-4=2

2-2=0

1+0+1+1+0+0+1+1+0

256+64+32+4+2=358

c)

1023

1023-512=511

511-256=255

255-128=127

127-64=63

63-32=31

31-16=15

15-8=7

7-4=3

3-2=1

0

2-1=1
1+1+1+1+1+1+1+1+1+1
512+256+128+64+32+16+8+4+2+1=1023



3) Convert the following hex numbers to decimal.


a)

CAB

2048+1024+512+256+128+64+32+16+8+4+2+1

1+1+0+0+1+0+1+0+1+0+1+1

3243

b)

BOO

2048+1024+512+256+128+64+32+16+8+4+2+1

1+0+1+0+1+1+1+0+1+1+1+1

2799



4) Convert the following decimal numbers to hex:


a)

64,206

2^15+2^14+2^13+2^12+2^11+2^10+2^9+2^8+2^7+2^6+2^5+2^4+2^3+2^2+2^1+2^0

1+1+1+1+1+0+1+0+1+1+0+0+1+1+1+0

32768+16384+8192+4096+2048+1024+512+256+128+64+32+16+8+4+2+1

FACE
b)

16,383

2^13+2^12+2^11+2^10+2^9+2^8+2^7+2^6+2^5+2^4+2^3+2^2+2^1+2^0

1+1+1+1+1+1+1+1+1+1+1+1+1

8192+4096+2048+1024+512+128+64+32+16+8+4+2+1

3FFF



10) Write PIPPIN programs to perform the following tasks:



a) Swap the contents of the cells 12 and 13.

LOD 12

STO 14

LOD 13

STO 12

LOD 14

STO 13

b) If [X] < [Y] for two cells X and Y, then place 1 in the accumulotor; otherwise, place 0 in the accumulator.

LOD X

SUB X

NOT STO X

CPL X



11) Write a PIPPIN program that will replace the contents of cell X with half its original value, ignoring any remainders, so the values 8 and 9 would both be replaced by 4.

LOD X

DIV #2

STO X





For your viewing pleasure, and possible reference to help you figure out how to convert binary to decimal, decimal to binary, binary to hex, decimal to hex; click on the following link.


Binary to Decimal to Hex Converter




For those of you who want a reference to choose background colors, click on this link below.


Color Names with Hex and Decimal Codes


Return to Dean's Web Project

Counter Return to index