Question

In: Computer Science

1) given the 8-bit binary number of 10111110 (two) a)what is the hex representation of this...

1) given the 8-bit binary number of 10111110 (two)

a)what is the hex representation of this number/

b) what is the decimal value if this number which is an 8-bit number as a two complement signed number. all steps included

c)what is the decimal value of this number as an 8-bit unsigned number, please write all steps

2) given the decimal number (-0.875) or (-7/8) convert it to single-precision floating-point. please show the easiest way to get to this,.

Solutions

Expert Solution

a)
Hexadecimal     Binary
    0           0000
    1           0001
    2           0010
    3           0011
    4           0100
    5           0101
    6           0110
    7           0111
    8           1000
    9           1001
    A           1010
    B           1011
    C           1100
    D           1101
    E           1110
    F           1111
Use this table to convert from binary to hexadecimal
Converting 10111110 to hexadecimal
1011 => B
1110 => E
So, in hexadecimal 10111110 is 0xBE
Answer: 0xBE

b)
since left most bit is 1, this number is negative number.
so, follow these steps below to convert this into a decimal value.
I. first flip all the bits. Flip all 0's to 1 and all 1's to 0.
   10111110 is flipped to 01000001
II. Add 1 to above result
01000001 + 1 = 01000010
III. Now convert this result to decimal value
=> 1000010
=> 1x2^6+0x2^5+0x2^4+0x2^3+0x2^2+1x2^1+0x2^0
=> 1x64+0x32+0x16+0x8+0x4+1x2+0x1
=> 64+0+0+0+0+2+0
=> 66
Answer: -66

c)
=> 10111110
=> 1x2^7+0x2^6+1x2^5+1x2^4+1x2^3+1x2^2+1x2^1+0x2^0
=> 1x128+0x64+1x32+1x16+1x8+1x4+1x2+0x1
=> 128+0+32+16+8+4+2+0
=> 190
Answer: 190

d)
Converting 0.875 to binary
   Convert decimal part first, then the fractional part
   > First convert 0 to binary
   Divide 0 successively by 2 until the quotient is 0
   Read remainders from the bottom to top as 
   So, 0 of decimal is  in binary
   > Now, Convert 0.875 to binary
      > Multiply 0.875 with 2.   Since 1.75 is >= 1. then add 1 to result
      > Multiply 0.75 with 2.    Since 1.5 is >= 1. then add 1 to result
      > Multiply 0.5 with 2.     Since 1.0 is >= 1. then add 1 to result
      > This is equal to 1, so, stop calculating
   0.875 of decimal is .111 in binary
   so, 0.875 in binary is .111
-0.875 in simple binary => .111
so, -0.875 in normal binary is .111 => 1.11 * 2^-1

single precision:
--------------------
sign bit is 1(-ve)
exp bits are (127-1=126) => 01111110
   Divide 126 successively by 2 until the quotient is 0
      > 126/2 = 63, remainder is 0
      > 63/2 = 31, remainder is 1
      > 31/2 = 15, remainder is 1
      > 15/2 = 7, remainder is 1
      > 7/2 = 3, remainder is 1
      > 3/2 = 1, remainder is 1
      > 1/2 = 0, remainder is 1
   Read remainders from the bottom to top as 1111110
   So, 126 of decimal is 1111110 in binary
frac bits are 11000000000000000000000

so, -0.875 in single-precision format is 1 01111110 11000000000000000000000
in hexadecimal it is 0xBF600000

Related Solutions

1. Given the 8 bit hex number 0x5E, what smallest hex value would you have to...
1. Given the 8 bit hex number 0x5E, what smallest hex value would you have to add to set the Overflow flag? 2. Given the 8 bit hex number 0x6E, what smallest hex value would you have to add to set the Carry Flag? Please give detailed explanation on how to solve.
7.   __________________ representation of a binary number uses the bit following (after)       the most significant...
7.   __________________ representation of a binary number uses the bit following (after)       the most significant bit as the sign bit, making it possible to determine whether an       integer is negative or positive.       A). 2’s complement       B). 1’s complement       C). bitwise complement       D). bitwise negation 8. To obtain the 2’s complement of a binary number, it is necessary to flip (reverse) the       bits and ___________________________.       A). subtract 1       B). divide by 1...
What is the 11 bit, binary representation of -108? What is the hexadecimal equivalent of this...
What is the 11 bit, binary representation of -108? What is the hexadecimal equivalent of this number?
1) Convert negative fractional decimal number to 8-bit binary number: – 16.625 (use 2's complement binary...
1) Convert negative fractional decimal number to 8-bit binary number: – 16.625 (use 2's complement binary format) Hint: –17 + 0.375 Given the hint above, the fractional number will be divided into two parts, - Whole number, - Fractional part, must be positive (2) Proof to check that your calculation above is correct
c) Using the 32-bit binary representation for floating point numbers, represent the number 1011100110011 as a...
c) Using the 32-bit binary representation for floating point numbers, represent the number 1011100110011 as a 32 bit floating point number. i) A digital camera processes the images images in the real-world and stores them in binary form. Using the principles of digital signal processing, practically explain how this phenomenon occurs.
What decimal value does the 8-bit binary number 10011110 have if: a) it is interpreted as...
What decimal value does the 8-bit binary number 10011110 have if: a) it is interpreted as an unsigned number? b) It is on a computer using signed-magnitude representation? c) It is on a computer using one’s complement representation? d) It is on a computer using two’s complement representation?
Convert the following statement into the 8-bit unsigned binary ASCII representation: Bob’s laptop receives the frame...
Convert the following statement into the 8-bit unsigned binary ASCII representation: Bob’s laptop receives the frame containing the ARP reply message. First, convert each character into it's ASCII equivalents. Then, convert to a Binary number. For example: Bob's -> 066 111 098 039 115 -> 01000010 01101111 01100010 00100111 01110011 Remember, each Binary number has to be 8-bits.
(1) Convert negative fractional decimal number to 8-bit binary number: – 6.625 Hint: –7 + 0.375...
(1) Convert negative fractional decimal number to 8-bit binary number: – 6.625 Hint: –7 + 0.375 Given the hint above, the fractional number will be divided into two parts, - Whole number, - Fractional part, must be positive (2) Use 2's complement binary format to convert negative fractional decimal number to 8-bit binary number: – 6.625 (3) Proof to check that your representation calculation for (1) & (2) is correct
Represent the following numbers in binary 8-bit representation using singed magnitude, one's complement, two's complement, and...
Represent the following numbers in binary 8-bit representation using singed magnitude, one's complement, two's complement, and excess-127 representations: a) 48 b) -35
Write a program in C that takes as input an 8-bit binary number and prints the...
Write a program in C that takes as input an 8-bit binary number and prints the next 10 binary numbers. Define a binary number as int binNum[8]; Use binNum[0] to store the most significant (i.e., leftmost) bit and binNum[7] to store the least significant bit. Ask the user to input the first binary number with each bit separated by at least one space.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT