Binary and Decimal Arithmetic: Homework Solutions, Slides of Computer Science

The solutions to homework #2 in chapter 2 and chapter 3 of an unspecified textbook. It covers binary and decimal arithmetic, including addition, subtraction, and overflow. In chapter 2, it presents the answers to various binary and decimal arithmetic problems. In chapter 3, it explains the concept of short circuit in digital electronics.

Typology: Slides

2012/2013

Uploaded on 04/30/2013

ekaan
ekaan 🇮🇳

4.5

(4)

54 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Home Work # 2
Chapter 2:
2.18 The answers are:
(a) 1100 (binary) or 12 (decimal)
(b) 1011000 (binary) or 88 (decimal)
(c) 1011 (binary) or 11 (decimal)
(d) 11 (binary) or 3 (decimal)
2.20 (a) 1100 + 0011 = 1111
-4 + 3 = -1
(b) 1100 + 0100 = 0000
-4 + 4 = 0
(c) 0111 + 0001 = 1000 OVERFLOW!
7 + 1 = -8
(d) 1000 - 0001 = 1000 + 1111 = 0111 OVERFLOW!
-8 - 1 = -8 + (-1) = 7
(e) 0111 + 1001 = 0000
7 + -7 = 0
2.21 Overflow has occurred if both operands are positive and the result is negative, or if both operands are
negative and the result is positive.
2.30 (a) 01010111
(b) 100
(c) 10100000
(d) 00010100
(e) 0000
(f) 0000
2.38 Let N = n & 1000, M = m & 1000
Overflow = (N AND M) OR ((N OR M) AND ((NOT s) AND 1000))
2.40 (a) 2
(b) -17
(c) Positive infinity. NOTE: This was not explained in the text.
(d) -3.125
Docsity.com
pf3

Partial preview of the text

Download Binary and Decimal Arithmetic: Homework Solutions and more Slides Computer Science in PDF only on Docsity!

Home Work # 2

Chapter 2:

2.18 The answers are: (a) 1100 (binary) or 12 (decimal) (b) 1011000 (binary) or 88 (decimal) (c) 1011 (binary) or 11 (decimal) (d) 11 (binary) or 3 (decimal)

2.20 (a) 1100 + 0011 = 1111 -4 + 3 = - (b) 1100 + 0100 = 0000 -4 + 4 = 0 (c) 0111 + 0001 = 1000 OVERFLOW! 7 + 1 = - (d) 1000 - 0001 = 1000 + 1111 = 0111 OVERFLOW! -8 - 1 = -8 + (-1) = 7 (e) 0111 + 1001 = 0000 7 + -7 = 0

2.21 Overflow has occurred if both operands are positive and the result is negative, or if both operands are negative and the result is positive.

2.30 (a) 01010111 (b) 100 (c) 10100000 (d) 00010100 (e) 0000 (f) 0000

2.38 Let N = n & 1000, M = m & 1000 Overflow = (N AND M) OR ((N OR M) AND ((NOT s) AND 1000))

2.40 (a) 2 (b) - (c) Positive infinity. NOTE: This was not explained in the text. (d) -3.

Chapter 3:

3.7 There is short circuit (path from Power to Ground) when either A = 1 and B = 0 or A = 0 and B = 1.