‼️

Quiz 1

TypeAssessment
  1. Convert the octal number A into the corresponding bases. Assume that A is unsigned. When you type your answer, the prefixes are optional.

A=0o260

Hexadecimal:

8-bit Binary:


  1. A is an octal number being represented as a 8-bit 2's complement number. Is the 2's complement value positive or negative?

A = 571


  1. Fill in the blank in the below statement to satisfy the equation. Assume all numbers are 8-bit. Please give your answer in decimal.

    0b10111011 & ~( 1 << ? ) = 0b10101011

    • Answer

      10111011

      & 11101111

      =10101011

      ~11101111= 00010000 = (16)10

      (16)10 = 1 << 4

      —> 0b10111011 & ~( 1 << 4 ) = 0b10101011

  1. Fill in the below statement to satisfy the equation. Assume all numbers are 8-bit. Please give your answer in 8-bit binary.

    (0b10101010 ^ ? ) = 0b11001010

    • Answer

      10101010

      ^ 01111101

      = 11010111

  1. Fill in the below statement to satisfy the equation. Assume all numbers are 8-bit. Please give your answer in hexadecimal.

    0b11100101 << (? >> 0x2) = 0b11001010

    • Answer

      11100101

      left shift by 1

      =. 11001010

      0x4 >> 0x2 = 1

      —> 0b11100101 << (0x4 >> 0x2) = 0b11001010

  1. What could this IEEE number represent based on the given information?

    0 ________ 00001110101010000010010

    • Answer

      A positive number or NaN

  1. What could this IEEE number represent based on the given information?

    0 00000000 ________________________________

    • Answer

      either 0 or a non-normalized number

  1. What is the result obtained by adding the following two 5-bit unsigned binary numbers? Write your answer in 5-bit unsigned binary (ignoring carry-out and do not include spaces in between)

    11101 + 01110

    The answer for 11101 + 01110 in 5-bit unsigned binary is:

    In decimal is:

    • Answer

      5-bit unsigned binary: 01011

      Decimal: 43

      The answer overflows since it is larger than 31, the biggest number allowed in a 5 bit binary.

12. What is the result obtained by adding the following two 2's complement 5-bit binary numbers? Write your answer in 2's complement 5-bit binary (ignoring carry-out, and do not include spaces in between).

10011 + 10110

5-bit binary:

Decimal:

  • Answer

    5-bit binary: 01001

    Decimal: -23

    Overflow since carry-in is 0 and carry-out is 1. Also it is larger than -16, the largest negative number allowed in a 5-bit binary.

  1. What is the result obtained by subtracting the following two 2's complement 5-bit binary numbers? Write your answer in 2's compliment 5-bit binary (ignoring carry-out and do not include spaces in between)

    10100 - 01000

    • Answer

      01100

      -20

      Overflow since carry-in is 0 and carry-out is 1. Also the decimal is larger than -16, the biggest negative number allowed in a 5-bit binary.

16. Given the following truth table, determine what the missing operator is in the corresponding boolean expression:

OUT = (A ^ ~B)___C

  • Answer

    Missing Operator: &

  1. Using DeMorgan’s Law, match the answer choices below to the equivalent logical expressions

    A | (B | ~C)

    • Answer

      A | ~(~B & C)

      ~ (~ A & ~(~B & C))

    A & (~B | ~C)

    • Answer

      A & ~(B & C)

      ~(~A | ~(~B | ~C))