Introduction To Computing Systems
Introduction To Computing Systems
3rd Edition
ISBN: 9781260150537
Author: PATT, Yale N., Patel, Sanjay J.
Publisher: Mcgraw-hill,
Question
Book Icon
Chapter 2, Problem 11E

a.

Program Plan Intro

Steps to convert decimal to binary:

  • Form the following equation to represent the decimal value “N” in binary representation,

N=26×b6+25×b5+24×b4+23×b3+22×b2+21×b1+20×b0

  • Repeat the following steps till the left side of the equation becomes “0”.
    • If the value of “N” is even, then the rightmost digit is “0”, and otherwise it is “1”.
    • Minus “1” or “0” from the value of “N”, neglect least significant term from the right side of the equation.
    • Divide left and right sides of the equation by “2”. Each repetition gives the value of one coefficient “bj
  • Extend the sign bit by adding 0’s to the left, if the original decimal value is positive.
  • Extend the sign bit by adding 0’s to the left and make the complement of this 2’s complement representation, if the original decimal value is negative.

b.

Explanation of Solution

Conversion of decimal number “64” to binary number:

  • Form the following equation to represent the decimal value “64” in binary representation,

64=26×b6+25×b5+24×b4+23×b3+22×b2+21×b1+20×b0

  • The given value is positive hence, the Left most Significant Bit (LSB) “b7” in eight-bit representation is “0”.
  • If the value “64” is even, then the rightmost digit is “0”.
  • The given value is even hence, the rightmost digit “b0” is “0”.
  • Subtract the value “0” from the both sides of the equation as follows,

64=26×b6+25×b5+24×b4+23×b3+22×b2+21×b1

  • Divide left and right sides of the equation by “2”. The equation will become as follows,

32=25×b6+24×b5+23×b4+22×b3+21×b2+20×b1

  • The value “32” is even hence, the rightmost digit “b1” is “0”.
  • Subtract the value “0” from the both sides of the equation as follows,

32=25×b6+24×b5+23×b4+22×b3+21×b2

  • Divide left and right sides of the equation by “2”. The equation will become as follows,

16=24×b6+23×b5+22×b4+21×b3+20×b2

  • The value “16” is even hence, the rightmost digit “b2” is “0”

c.

Explanation of Solution

Conversion of decimal number “33” to binary number:

  • Form the following equation to represent the decimal value “33” in binary representation,

33=26×b6+25×b5+24×b4+23×b3+22×b2+21×b1+20×b0

  • The given value is positive hence, the Left most Significant Bit (LSB) “b7” in eight-bit representation is “0”.
  • If the value “33” is odd, then the rightmost digit is “1”.
  • The given value is odd hence, the rightmost digit “b0” is “1”.
  • Subtract the value “1” from the both sides of the equation as follows,

32=26×b6+25×b5+24×b4+23×b3+22×b2+21×b1

  • Divide left and right sides of the equation by “2”. The equation will become as follows,

16=25×b6+24×b5+23×b4+22×b3+21×b2+20×b1

  • The value “16” is even hence, the rightmost digit “b1” is “0”.
  • Subtract the value “0” from the both sides of the equation as follows,

16=25×b6+24×b5+23×b4+22×b3+21×b2

  • Divide left and right sides of the equation by “2”. The equation will become as follows,

8=24×b6+23×b5+22×b4+21×b3+20×b2

  • The value “8” is even hence, the rightmost digit “b2” is “0”

d.

Explanation of Solution

Conversion of decimal number “-128” to binary number:

  • Form the following equation to represent the decimal value “128” in binary representation,

128=26×b6+25×b5+24×b4+23×b3+22×b2+21×b1+20×b0

  • The given value is negative hence, the Left most Significant Bit (LSB) “b7” in eight-bit representation is “1”.
  • If the value “128” is even, then the rightmost digit is “0”.
  • The given value is even hence, the rightmost digit “b0” is “0”.
  • Subtract the value “0” from the both sides of the equation as follows,

128=26×b6+25×b5+24×b4+23×b3+22×b2+21×b1

  • Divide left and right sides of the equation by “2”. The equation will become as follows,

64=25×b6+24×b5+23×b4+22×b3+21×b2+20×b1

  • The value “64” is even hence, the rightmost digit “b1” is “0”.
  • Subtract the value “0” from the both sides of the equation as follows,

64=25×b6+24×b5+23×b4+22×b3+21×b2

  • Divide left and right sides of the equation by “2”. The equation will become as follows,

32=24×b6+23×b5+22×b4+21×b3+20×b2

  • The value “32” is even hence, the rightmost digit “b2” is “0”

e.

Explanation of Solution

Conversion of decimal number “127” to binary number:

  • Form the following equation to represent the decimal value “127” in binary representation,

127=26×b6+25×b5+24×b4+23×b3+22×b2+21×b1+20×b0

  • The given value is positive hence, the Left most Significant Bit (LSB) “b7” in eight-bit representation is “0”.
  • If the value “127” is odd, then the rightmost digit is “1”.
  • The given value is odd hence, the rightmost digit “b0” is “1”.
  • Subtract the value “1” from the both sides of the equation as follows,

126=26×b6+25×b5+24×b4+23×b3+22×b2+21×b1

  • Divide left and right sides of the equation by “2”. The equation will become as follows,

63=25×b6+24×b5+23×b4+22×b3+21×b2+20×b1

  • The value “63” is odd hence, the rightmost digit “b1” is “1”.
  • Subtract the value “1” from the both sides of the equation as follows,

62=25×b6+24×b5+23×b4+22×b3+21×b2

  • Divide left and right sides of the equation by “2”. The equation will become as follows,

31=24×b6+23×b5+22×b4+21×b3+20×b2

  • The value “31” is odd hence, the rightmost digit “b2” is “1”

Blurred answer
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education