Homework 1 : Solution

1.  None
2.  None

3. 

    a)  27 = 1*1 + 1*2 + 1*8 + 1*16

    b) 124 = 4*1 + 7*8 + 1*64

    c) 1016 = 8*1 + (F=15)*16 + 3*256

    d) 13.6875 = 1*8 + 1*4 + 1*1 + 1*(1/2) + 1*(1/8) + 1*(1/16)

 

4.

   a)254 --> 11111110
  
     254/2 =  127     R0
      127/2 =   63      R1
      63/2 =     31      R1
      31/2 =     15      R1
      15/2 =     7        R1
      7/2 =       3        R1
      3/2 =       1        R1
      1/2=        0        R1

   b)174o -->  001 111 100
        1->001
        7->111
        4->100

   c)2.4375 -->  10.0111
            //Decimal portion evaluation
         .4375 * 2  = .875  -->  0
         .875  * 2  = 1.75   -->  1
         .75 * 2  = 1.5        -->  1
         .5 * 2  = 1.0         -->   1

   d))0C5h -->  1100 0101
            C --> 1100
            5 -->  0101

5.

   a)   1
          15o
        +53o
        ---------
          70o

   b)  1111
          0001
        +1001
         00111
        ---------
         10001

 

   c)   110100
        -011010
        -------------
           11010

    d)   101
        x 011
       ------------
            101
          1010
       +  000
    --------------
          1111

6. 

   a)  -26  -->  111010
        First, convert 26 to binary --> 11010
        Next, tack on the sign bit, in this case negative = 1
        Answer : 111010

   b)  -26 --> 100110
        First, convert 26 to binary, using 6 bits --> 011010
        Now flip the bits -->  100101
        Finally add 1 -->  Answer : 100110

    c) Smallest : -128
  
      Largest  : 127

    d) 11111100  -->  1100

 

7.

   a) -6 --> 1010 in 2s complement
        Boolean Expression : x8 + ~x4 + x2 + ~x1

   b) Logic Circuit :
       

 

 

8.

State

Next State

New

Equal

Mux

Open/Closed

S1

S1

0

X

C1

close

S1

E2

1

0

C1

close

S1

S2

1

1

C1

close

S2

S2

0

X

C2

close

S2

E3

1

0

C2

close

S2

S3

1

1

C2

close

S3

S3

0

X

C3

close

S3

CLOSE

1

0

C3

close

S3

OPEN

1

1

C3

open

E2

E2

0

X

-

close

E2

E3

1

X

-

close

E3

E3

0

X

-

close

CLOSE

OPEN

-

-

-

open

OPEN

CLOSE

-

-

-

close

Most likely, an external reset would be required to take the lock from the Open/Close state -> S1