1. Engineering
2. Computer Science
3. single bit adders the following questions concern the results of...

# Question: single bit adders the following questions concern the results of...

###### Question details
---Single Bit Adders---

The following questions concern the results of an adder that operates
over single bits, including a carry bit.  Give the results for the addition,
along with the carry bit, separated by a semicolon.  For example:

1.) What is 1 + 1 without a carry bit?
0;1

2.) What is 0 + 0 without a carry bit?
0;0

3.) What is 1 + 1 with a carry bit?

4.) What is 1 + 0 with a carry bit?

5.) What is 0 + 0 with a carry bit?

Tell the results of the following binary addition operations on twos complement
integers. Truncate the answer to 8 bits. For each one, make sure you identify
whether they created an overflow, a carry, or both.  For an overflow, put a
capital V.  For a carry, put a capital C.  If both, put VC.  Place this
information after the 8-bit answer, separated by a space.  For example:

6.) What is
00101001
+11101001?
00010010 C

7.) What is
10010001
+01100110?

8.) What is
11011011
+01100011?

9.) What is
00111101
+10110001?

10.) What is
10111101
+10000001?

---Negating (i.e. making negative) Binary Numbers in Twos Complement---

For each of the following binary numbers, specify the negated value in binary.
For this to work out, we need to negate using twos complement - flip all the
bits and add 1.  For example:

00110011 original
11001100 all bits flipped

For these problems, just report the final negated value, not the intermediate
step.

11.) What is the negated version of:
01101101?

12.) What is the negated version of:
11001001?

13.) What is the negated version of:
11100100?

---Subtracting Binary Numbers in Twos Complement---

The following problems ask you to subtract one binary number from another.
While this can be done directly, it is typically easier to negate the second number
(using the technique you used for problems 11 - 13), and then add the two together.
Truncate your answer to 8 bits.  There will be several steps, but ONLY show the
answer, in the same way as you reported problems 6 - 10.  Note that this means that
you will ALSO NEED TO SPECIFIY the overflow and carry bits where appropriate, using
the same format used in the "Binary Addition Over Multiple Bits" section.

14.) What is
11001101
-01100100?

15.) What is
01101001
-10110101?

16.) What is
10010110
-11101010?

17.) What is
10110010
-00000001?

---Basic Bitwise Operations---

Recall that bitwise AND is specified with &, bitwise OR with |, and bitwise
XOR with ^.

18.) What is
01101101
&10101011?

19.) What is
11001001
&11110001?

20.) What is
10011011
&10011011?

21.) What is
01101110
&10010001?

22.) What is
10011011
|11100101?

23.) What is
01101101
|01101101?

24.) What is
11010001
|11110001?

25.) What is
10111101
|00000001?

26.) What is
01101101
^10010010?

27.) What is
01101010
^11101011?

28.) What is
11001010
^11100101?

29.) What is
11110101
^00001011?

---Bit Shifting---

Recall that shift left is denoted by <<, and shift right is denoted
by >>.  Additionally, there is a logical and an arithmetic form of
shift right.

For this section, all your answers should consist of exactly 8 result bits.

30.) What is
11010010 << 1?

31.) What is
11101010 << 2?

32.) What is
01010011 >> 1,
for _logical_ shift right?

33.) What is
01010011 >> 1,
for _arithmetic_ shift right?

34.) What is
01110011 >> 2,
for _logical_ shift right?

35.) What is
01110011 >> 2,
for _arithmetic_ shift right?

36.) What is
11010011 >> 1,
for _logical_ shift right?

37.) What is
11010011 >> 1,
for _arithmetic_ shift right?

38.) What is
11110011 >> 2,
for _logical_ shift right?

39.) What is
11110011 >> 2,
for _arithmetic_ shift right?

Look at http://www.cprogramming.com/tutorial/bitwise_operators.html
and read how bitwise operations are useful.  Generally, you are not going to AND
two numbers together that you do or do not know the values of.  Instead,
you will usually take a number you DO NOT know and perform a bitwise
operation on it with a number that you DO know.  The known number above is
called a "mask", because it allows you to selectively observe the values of
just the bits you are interested in.  This can be done to inspect, set, and
flip specific bits in the unknown number. In the following problems, the unknown
number has all X's, and the known number has all 1's and 0's.  Write the
answer.  Each bit of the answer is either 1, 0, or X, where X
is the same bit value as the corresponding bit in the unknown number.

40.) What is
XXXXXXXX
|11001010?

41.) What is
XXXXXXXX
&10110110?

For the following three questions, remember that bit numbers start
numbering from 0, and that hexadecimal numbers are always unsigned.
In addition to showing the mask you would use, also show the operation
you would use, like so: &0x0020.  (i.e., AND the original number with

42.) Specify the mask you would need to inspect bit 5 of the unknown number.
Express it as a 4-digit hexadecimal number.

43.) Specify the mask you would need to set bit 5 of the unknown number to zero.
That is, the result of this operation results in a new number, which the unknown
number should be subsequently set to.  Express it as a 4-digit hexadecimal number.

44.) Specify the mask you would need to set bit 5 of the unknown number to one.
That is, the result of this operation results in a new number, which the unknown
number should be subsequently set to.  Express it as a 4-digit hexadecimal number.