EBK COMPUTER SCIENCE
EBK COMPUTER SCIENCE
13th Edition
ISBN: 8220106892572
Author: BRYLOW
Publisher: PEARSON
Expert Solution & Answer
Book Icon
Chapter 1, Problem 33CRP

a.

Explanation of Solution

Convert 5+1 into two’s complement notation, converting any subtraction problem to an equivalent addition problem and perform the addition and convert the answer to base ten notations:

The condition of overflow is:

  • Check the number is positive or negative.
  • When the number is positive, convert the number from base ten to binary.
  • When the number is negative, convert the number from base ten to binary, complement the binary number and add 1.
  • Convert number 1 into two’s complement notation.

2101

  • The binary representation is the sequence of the remainder from down to bottom (1)10=(1)2
  • To make the above binary representation to 5 bits, put 0 before the binary number (1)2=(00001)2
  • The two’s complement notation of 1 is 00001.
  • Convert number 5 into two’s complement notation.

2522121001

  • The binary representation is the sequence of the remainder from down to bottom (5)10</

b.

Explanation of Solution

Convert 51 into two’s complement notation, converting any subtraction problem to an equivalent addition problem and perform the addition and convert the answer to base ten notations:

The condition of overflow is:

  • Check the number is positive or negative.
  • When the number is positive, convert the number from base ten to binary.
  • When the number is negative, convert the number from base ten to binary, complement the binary number and add 1.
  • Convert number 1 into two’s complement notation.

2101

  • The binary representation is the sequence of the remainder from down to bottom (1)10=(1)2
  • To make the above binary representation to 5 bits, put 0 before the binary number (1)2=(00001)2
  • Take the complement of the above binary number.

0000111110

  • Add 1 to the above complement binary number.

11110+111111

  • The two’s complement notation of (1)2 is 11111
  • Convert number 5 into two’s complement notation

c.

Explanation of Solution

Convert 125 into two’s complement notation, converting any subtraction problem to an equivalent addition problem and perform the addition and convert the answer to base ten notations:

The condition of overflow is:

  • Check the number is positive or negative.
  • When the number is positive, convert the number from base ten to binary.
  • When the number is negative, convert the number from base ten to binary, complement the binary number and add 1.
  • Convert number 12 into two’s complement notation.

21226023021101

  • The binary representation is the sequence of the remainder from down to bottom (12)10=(1100)2 .
  • To make the above binary representation to 5 bits, put 0 before the binary number (12)10=(01100)2 .
  • The two’s complement notation of (12)10 is 01100.
  • Convert number 5 into two’s complement notation.

2522121001

  • The binary representation is the sequence of the remainder from down to bottom (5)10=(101)2
  • To make the above binary representation to 5 bits, put 0 before the binary number (5)10=(00101)2
  • Take the complement of the above binary number

d.

Explanation of Solution

Convert 87 into two’s complement notation, converting any subtraction problem to an equivalent addition problem and perform the addition and convert the answer to base ten notations:

The condition of overflow is:

  • Check the number is positive or negative.
  • When the number is positive, convert the number from base ten to binary.
  • When the number is negative, convert the number from base ten to binary, complement the binary number and add 1.
  • Convert number 8 into two’s complement notation.

2824022021001

  • The binary representation is the sequence of the remainder from down to bottom (8)10=(1000)2
  • To make the above binary representation to 5 bits, put 0 before the binary number (8)10=(01000)2
  • The two’s complement notation of (8)10 is 01000.
  • Convert number 7 into two’s complement notation.

2723121101

  • The binary representation is the sequence of the remainder from down to bottom (7)10=(111)2
  • To make the above binary representation to 5 bits, put 0 before the binary number (7)10=(00111)2
  • Take the complement of the above binary number

e.

Explanation of Solution

Convert 12+5 into two’s complement notation, converting any subtraction problem to an equivalent addition problem and perform the addition and convert the answer to base ten notations:

The condition of overflow is:

  • Check the number is positive or negative.
  • When the number is positive, convert the number from base ten to binary.
  • When the number is negative, convert the number from base ten to binary, complement the binary number and add 1.
  • Convert the number 12 into two’s complement notation.

21226023021101

  • The binary representation is the sequence of the remainder from down to bottom (12)10=(1100)2
  • To make the above binary representation to 5 bits, put 0 before the binary number (12)10=(01100)2
  • Take the complement of the above binary number.

0110010011

  • Add 1 to the above complement binary number.

10011+110000

  • The two’s complement notation of (11)10 is 10101

f.

Explanation of Solution

Convert 511 into two’s complement notation, converting any subtraction problem to an equivalent addition problem and perform the addition and convert the answer to base ten notations:

The condition of overflow is:

  • Check the number is positive or negative.
  • When the number is positive, convert the number from base ten to binary.
  • When the number is negative, convert the number from base ten to binary, complement the binary number and add 1.
  • Convert the number 11  into two’s complement notation.

21125122121001

  • The binary representation is the sequence of the remainder from down to bottom (11)10=(1011)2
  • To make the above binary representation to 5 bits, put 0 before the binary number (11)10=(01011)2
  • Take the complement of the above binary number.

0101110100

  • Add 1 to the above complement binary number.

10100+110101

  • The two’s complement notation of (11)10 is 10101

Blurred answer
Students have asked these similar questions
Change the following code so that there is always at least one way to get from the left corner to the top right, but the labyrinth is still randomized. The player starts at the bottom left corner of the labyrinth. He has to get to the top right corner of the labyrinth as fast he can, avoiding a meeting with the evil dragon. Take care that the player and the dragon cannot start off on walls. Also the dragon starts off from a randomly chosen position   public class Labyrinth {    private final int size;    private final Cell[][] grid;     public Labyrinth(int size) {        this.size = size;        this.grid = new Cell[size][size];        generateLabyrinth();    }     private void generateLabyrinth() {        Random rand = new Random();        for (int i = 0; i < size; i++) {            for (int j = 0; j < size; j++) {                // Randomly create walls and paths                grid[i][j] = new Cell(rand.nextBoolean());            }        }        // Ensure start and end are…
Change the following code so that it checks the following 3 conditions: 1. there is no space between each cells (imgs) 2. even if it is resized, the components wouldn't disappear 3. The GameGUI JPanel takes all the JFrame space, so that there shouldn't be extra space appearing in the frame other than the game.   Main():         Labyrinth labyrinth = new Labyrinth(10);         Player player = new Player(9, 0);        Dragon dragon = new Dragon(9, 9);         JFrame frame = new JFrame("Labyrinth Game");        GameGUI gui = new GameGUI(labyrinth, player, dragon);         frame.add(gui);        frame.setSize(600, 600);        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);        frame.setVisible(true);   public class GameGUI extends JPanel {    private final Labyrinth labyrinth;    private final Player player;    private final Dragon dragon; //labyrinth, player, dragon are just public classes     private final ImageIcon playerIcon = new ImageIcon("data/images/player.png");…
Make the following game user friendly with GUI, with some simple graphics. The GUI should be in another seperate class, with some ImageIcon, and Game class should be added into the pane. The following code works as this: The objective of the player is to escape from this labyrinth. The player starts at the bottom left corner of the labyrinth. He has to get to the top right corner of the labyrinth as fast he can, avoiding a meeting with the evil dragon. The player can move only in four directions: left, right, up or down. There are several escape paths in all labyrinths. The player’s character should be able to moved with the well known WASD keyboard buttons. If the dragon gets to a neighboring field of the player, then the player dies. Because it is dark in the labyrinth, the player can see only the neighboring fields at a distance of 3 units.  Cell Class: public class Cell { private boolean isWall; public Cell(boolean isWall) { this.isWall = isWall; } public boolean isWall() { return…

Chapter 1 Solutions

EBK COMPUTER SCIENCE

Ch. 1.3 - Prob. 1QECh. 1.3 - Prob. 2QECh. 1.3 - Prob. 3QECh. 1.3 - Prob. 4QECh. 1.3 - Prob. 5QECh. 1.3 - Prob. 6QECh. 1.4 - Here is a message encoded in ASCII using 8 bits...Ch. 1.4 - In the ASCII code, what is the relationship...Ch. 1.4 - Prob. 3QECh. 1.4 - Prob. 4QECh. 1.4 - Convert each of the following binary...Ch. 1.4 - Prob. 6QECh. 1.4 - What is the largest numeric value that could be...Ch. 1.4 - An alternative to hexadecimal notation for...Ch. 1.4 - What is an advantage of representing images via...Ch. 1.4 - Prob. 10QECh. 1.5 - Convert each of the following binary...Ch. 1.5 - Convert each of the following base ten...Ch. 1.5 - Convert each of the following binary...Ch. 1.5 - Express the following values in binary notation:...Ch. 1.5 - Perform the following additions in binary...Ch. 1.6 - Convert each of the following twos complement...Ch. 1.6 - Prob. 2QECh. 1.6 - Suppose the following bit patterns represent...Ch. 1.6 - Suppose a machine stores numbers in twos...Ch. 1.6 - In the following problems, each bit pattern...Ch. 1.6 - Prob. 6QECh. 1.6 - Prob. 7QECh. 1.6 - Prob. 8QECh. 1.6 - Prob. 9QECh. 1.6 - Prob. 10QECh. 1.6 - Prob. 11QECh. 1.7 - Prob. 1QECh. 1.7 - Prob. 3QECh. 1.7 - Prob. 4QECh. 1.8 - What makes Python an interpreted programming...Ch. 1.8 - Write Python statements that print the following:...Ch. 1.8 - Write Python statements to make the following...Ch. 1.8 - Write a Python statement that given an existing...Ch. 1.9 - Prob. 1QECh. 1.9 - Prob. 2QECh. 1.9 - Prob. 3QECh. 1.9 - Prob. 4QECh. 1.9 - Prob. 5QECh. 1.9 - Prob. 6QECh. 1.9 - Prob. 7QECh. 1.10 - Prob. 1QECh. 1.10 - Could errors have occurred in a byte from Question...Ch. 1.10 - Prob. 3QECh. 1.10 - Prob. 4QECh. 1.10 - Prob. 5QECh. 1.10 - Prob. 6QECh. 1 - Determine the output of each of the following...Ch. 1 - a. What Boolean operation does the circuit...Ch. 1 - a. If we were to purchase a flip-flop circuit from...Ch. 1 - Assume that both of the inputs in the following...Ch. 1 - The following table represents the addresses and...Ch. 1 - How many cells can be in a computers main memory...Ch. 1 - Prob. 7CRPCh. 1 - Prob. 8CRPCh. 1 - Prob. 9CRPCh. 1 - Prob. 10CRPCh. 1 - Suppose a picture is represented on a display...Ch. 1 - Prob. 12CRPCh. 1 - Prob. 13CRPCh. 1 - If each sector on a magnetic disk contains 1024...Ch. 1 - How many bytes of storage space would be required...Ch. 1 - Prob. 16CRPCh. 1 - Prob. 17CRPCh. 1 - Suppose a typist could type 60 words per minute...Ch. 1 - Prob. 19CRPCh. 1 - Prob. 20CRPCh. 1 - Prob. 21CRPCh. 1 - Prob. 22CRPCh. 1 - Prob. 23CRPCh. 1 - Prob. 24CRPCh. 1 - Prob. 25CRPCh. 1 - Prob. 26CRPCh. 1 - Prob. 27CRPCh. 1 - Prob. 28CRPCh. 1 - Prob. 29CRPCh. 1 - Prob. 30CRPCh. 1 - Prob. 31CRPCh. 1 - Prob. 32CRPCh. 1 - Prob. 33CRPCh. 1 - Prob. 34CRPCh. 1 - Prob. 35CRPCh. 1 - Prob. 36CRPCh. 1 - Prob. 37CRPCh. 1 - Prob. 38CRPCh. 1 - Prob. 39CRPCh. 1 - Prob. 40CRPCh. 1 - Prob. 41CRPCh. 1 - Prob. 42CRPCh. 1 - Prob. 43CRPCh. 1 - Prob. 44CRPCh. 1 - Prob. 45CRPCh. 1 - What would be the hexadecimal representation of...Ch. 1 - Prob. 47CRPCh. 1 - Prob. 48CRPCh. 1 - Prob. 49CRPCh. 1 - Prob. 50CRPCh. 1 - Prob. 51CRPCh. 1 - Prob. 52CRPCh. 1 - Prob. 53CRPCh. 1 - Prob. 54CRPCh. 1 - Prob. 55CRPCh. 1 - Prob. 56CRPCh. 1 - Prob. 57CRPCh. 1 - Prob. 58CRPCh. 1 - Write and test a Python script that, given a...Ch. 1 - Prob. 61CRPCh. 1 - Prob. 2SICh. 1 - Prob. 3SICh. 1 - Prob. 4SICh. 1 - Prob. 5SICh. 1 - Prob. 6SICh. 1 - Prob. 7SI
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