Starting from:

$30

ECE 212 - Homework 1 - Solved

Fundamentals of Logic Design 
 

1 [30 points total ] Binary, Octal and Hexadecimal Representation of Numbers

a) [6 pts each] Convert the following hexadecimal numbers into binary and octal numbers: [Show your work for full credit]
i) Hexadecimal = 0xC6E1

(A)      Binary =

C =(18+14+02+01)=1100

6=(08+14+12+01)=0110 E =(18+14+12+01)=1110 1=(08+04+02+11)=0001

=11000110111000012

(B)       Octal =

11000110111000012 = 001=(04+02+11)=1

100=(14+02+01)=4

011=(04+12+11)=3

011=(04+12+11)=3

100=(14+02+01)=4

001=(04+02+11)=1 =1433418 ii) Hexadecimal = 0xA08E

(A)      Binary =

C =(18+04+12+01)=1010

6=(08+04+02+01)=0000 E =(18+04+02+01)=1000 1=(18+14+12+01)=1110

=10100000100011102

(B)       Octal =

10100000100011102 = 001=(04+02+11)=1

010=(04+12+01)=2

000=(04+02+01)=0

010=(04+12+01)=2

001=(04+02+11)=1

011=(14+12+11)=6 =1202168

b) [6 pts each] Perform the following number-system conversions: [Show your work for full credit] i)
Decimal = 22710 =

  =113.5=1

  =56.5=1

  =28=0

  =14=0

  =7=0

  =3.5=1

  =1.5=1

  = .5=1

Binary = 111000112

ii)

Decimal = 59110 =

  =73  =7

  =9  =1

  =1  =1

  =   =1

Octal = 11178

iii)

Decimal = 1713=

  =107  =1

  =6  =11

6 mod16=6

Hexadecimal = 6b116

2 20 points total, 10 points each] Signed Magnitude, Two’s

Complement and One’s Complement Representation of Numbers
Determine the signed magnitude, two’s complement, and one’s complement representations for each of the decimal numbers below using the appropriate number of bits:[Show your work for full credit].

a) -119
Convert Non-negative decimal first

  =59  =1   =29  =1   =14  =1

  =7=0

  =3  =1

  =1  =1

  = .5=1

011101112 =11910

i) Signed Magnitude of 119

8 bit word length with signed MSbit:

111101112 ii) Two’s Complement of 119

011101112 =11910

One’s compliment 8-bit creates signed MSbit

011101112 to 100010002

Add a unity for a Two’s compliment Adding one to low order bit.

100010002+1=100010012

Convert base 2 back to base 10

100010012 =−11910

iii) Signed Magnitude of -119

8 bit word length with unsigned MSbit:

100010012 to 011101102

Add a unity for a Two’s compliment Adding one to low order bit.

011101102+1=011101112 011101112 =11910 iv) Two’s Complement of -119

One’s compliment 8-bit creates unsigned MSbit 100010012 =

b) +71
  =35  =1

  =17  =1

  =8  =1

  =4=0   =2=0   =1=0

  =   =1

01000111=712

i) Signed Magnitude =

8 bit word length with signed MSbit:

11000111 ii) Two’s Complement =

One’s compliment 8-bit creates signed MSbit

01000111 to 10111000 Add a unity for a Two’s compliment

Adding one to low order bit.

101110002+1=101110012

101110012 =7110

3 [26 points total, 6.5 points each] Two’s Complement Addition
Perform the following addition operations using 8-bit two’s complement representations.

(i)        Indicate if there was overflow

(ii)      Also, explain the criterion you used to determine whether of not there was overflow.

[Show your work for full credit].

•       number carries are in orange

•       overflow is in red

a)
Addends signs and result are all negative therefore no overflow.

(Cn = Cot)

1 0111 0000

10011001

(1)

+10111000

101010001

b)
Addends signs are not the same and therefore no overflow.

(Cn = Cot)

1 1111 1110

11011101

(2)

+01111011

101011000

c)
Addends are the same and the result is opposite and therefore overflow occured. (Cn¬Cot)

1110 0000

01010001

(3)

+01111010

1100 1011

d)
Addends signs and result are all negative therefore no overflow.

(Cn = Cot)

1 1000 0000

11010101

(4)

+11001000
110011101

4 [24 points total, 8 points each] Binary Math Use two’s complement binary math to perform the operations below as a binary addition. Show all work. Assume 8-bit binary values.

a)
(−1510−610)

−(15=(18+14+12+11)=11112)

 −(6=(08+14+12+01)=01102)


11112 −1102 −10101

−(116+0+14+0+11) −21

b)
(3210−1210)

(32=(132+016+08+04+02+01)=100000)

 −(12=(18+14+02+01)=1100)

100000

−1100
−001100=(110011+1)=110100

100000

 

1010100

10100

(116+08+14+02+01)=20

c)
(−10310−8810)

−(103=(164+132+016+08+14+12+11)=11001112)

−(88=(164+032+116+18+04+02+01)=10110002)

11001112

10110002

 

101111112

−101111112 =−(1128+064+132+116+18+14+12+11)=−191

More products