INTRO.TO COMPUTING SYSTEMS >INTL.ED.<
INTRO.TO COMPUTING SYSTEMS >INTL.ED.<
3rd Edition
ISBN: 9781260565911
Author: PATT
Publisher: MCG
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
Students have asked these similar questions
Solve this    "Do not use AI tools. Solve the problem by hand on paper only and upload a photo of your handwritten solution."
Specifications: Part-2Part-2: DescriptionIn this part of the lab, we will illuminate two 7-segment displays. You will need to understand 2's Complement todetermine when the input 4-bit binary number corresponds to a negative or positive number. To understand how anLED display works in Digital, please refer to the playWithLED_Display.dig file provided. You should play withdifferent input combinations to see how it influences the LED Display value. In the screenshot below, note how I wasable to generate the display of “3” on the Hex display by lighting up only certain input wires to the unit. Here is a picture of how the different segments light up to produce the different displays: Note in the picture above that we showed displays only from 0-8 since in 4-bit 2s complement representation, 8 is thelargest modulus value you can represent (the range of integers would be -8 to +7).Your circuit in Part-2 must accept a 4-bit 2's complement input {in3, in2, in1, in0} where in3 is the most…
Solve this    "Do not use AI tools. Solve the problem by hand on paper only and upload a photo of your handwritten solution."
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
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