Part One

Q1. Converting Between Number Bases

Consider A10 is the last two digits of your AUT ID number.

# # # # # # 9 2

A10 = 92

1. Convert A10 (from Decimal) to Binary - call the answer M2

  • Reading the right-hand column of the table up from the lowest cell to the highest we can see that the Base 10 to Base 2 conversion has resulted in the binary number:
  • M2 = 101 1100
92 / 2 = 46 r 0
46 / 2 = 23 r 0
23 / 2 = 11 r 1
11 / 2 = 5 r 1
5 / 2 = 2 r 1
2 / 2 = 1 r 0
1 / 2 = 0 r 1

2. Convert A10 (from Decimal) to Hexadecimal - call the answer N16

  • Reading the right-hand column of the table up from the lowest cell to the highest we can see that the Base 10 to Base 16 conversion has resulted in 5 and 12. The hexadecimal symbol for 12 is C. The resulting hexadecimal number is:
  • N16 = 5C
92 / 16 = 5 r 12
5 / 16 = 0 r 5

Q2. Unsigned Arithmetic Operations

Carry out the operations, assume that the numbers are unsigned and unlimited bits to represent:

a. Base 2: M2 + 110011012

  • M2 = 101 1100
  • 0101 1100 + 1100 1101
  • M2 + 1100 1101 = 1 0010 1001
  • 1 1 1
    0 1 0 1 1 1 0 0 +
    1 1 0 0 1 1 0 1 =
    1 0 0 1 0 1 0 0 1

b. Base 16: N16 + 9916

  • N16 = 5C
  • N16 + 9916 = 0101 1100 + 1001 1001
  • 0101 1100 + 1001 1001 = 1111 0101
  • 1111 = F | 0101 = 5
  • N16 + 9916 = F5
  • 1
    0 1 0 1 1 1 0 0 +
    1 0 0 1 1 0 0 1 =
    1 1 1 1 0 1 0 1

Q3. 2's Complement Conversion

Assume that numbers are represented as signed, 8-bit, 2's complement representations.
B10 = -A10
B10 = -92

Convert B10 to 8-bit 2's complement Binary; give the answer in 8-bit binary number form

  • A10 = M2
  • M2 = 101 1100
  • B10 = -M2 (2's complement)
  • -M2 (2's complement) = 1010 0011 + 1
  • B2 = -M2 (2's complement) = 1010 0100
  • 0 1 0 1 1 1 0 0
    inverse 1 0 1 0 0 0 1 1 + 1 =
    2's compl. 1 0 1 0 0 1 0 0

Q4. Bitwise Logical Operations

Assume that you have the number C2 found in Question 3, represented as a signed, 8-bit, 2's complement representation. Carry out the following operations:

a. C2 | 01110001 (OR)

  • If one or both of the numbers in a certain position have a value of 1, in an OR operation that position will be 1. If neither numbers have a 1, that position will be 0.
  • C2 = 1010 0100
  • C2 | 0111 0001 (OR) = 1111 0101
  • 1 1 1 1 1 1
    1 0 1 0 0 1 0 0 | (OR)
    0 1 1 1 0 0 0 1 =
    1 1 1 1 0 1 0 1

b. C2 & 01110001 (AND)

  • 1
    1 0 1 0 0 1 0 0 & (AND)
    0 1 0 0 1 1 0 1 =
    0 0 0 0 0 1 0 0
  • If both numbers in a certain position have a value of 1, in an AND operation that position will be 1. If one or both of the numbers have a value of 0, that position will be equal to 0.
  • C2 = 1010 0100
  • C2 & 0100 1101 (AND) = 0000 0100

c. C2 ^ 1101 1100 (XOR)

  • If one of the numbers in a certain position has a value of 1, in an XOR operation that position will be 1. If both numbers have a value of 1 or a 0, the position will have a value of 0.
  • C2 = 1010 0100
  • C2 ^ 1101 1100 (XOR) = 0111 1000
  • 1 0 1 0 0 1 0 0 ^ (XOR)
    1 1 0 1 1 1 0 0 =
    0 1 1 1 1 0 0 0

d. C2 << 4 (SHIFT LEFT ARITHMETIC)

  • 1 0 1 0 0 1 0 0
    0 1 0 0 1 0 0 0 << 1
    1 0 0 1 0 0 0 0 << 2
    0 0 1 0 0 0 0 0 << 3
    0 1 0 0 0 0 0 0 << 4
  • Shift left arithmetic is the same as shift left logical. Here, 0 is copied into the most significant bit location. The table shows the process step by step, shifting left arithmetically.
  • C2 = 1010 0100
  • C2 << 4 (SHIFT LEFT ARITHMETIC)
    = 0100 0000

Q5. ASCII Characters

The ASCII Character Set - 7-bit

00 NUL 01 SOH 02 STX 03 ETX
04 EOT 05 ENQ 06 ACK 07 BEL (\a)
08 BS (\b) 09 HT (\t) 0A LF (\n) 0B VT (\v)
0C FF (\f) 0D CR (\r) 0E SO 0F SI
10 DLE 11 DC1 12 DC2 13 DC3
14 DC4 15 NAK 16 SYN 17 ETB
18 CAN 19 EM 1A SUB 1B ESC
1C FS 1D GS 1E RS 1F US
20 SPACE 21 ! 22 " 23 #
24 $ 25 % 26 & 27 '
28 ( 29 ) 2A * 2B +
2C , 2D - 2E . 2F /
30 0 31 1 32 2 33 3
34 4 35 5 36 6 37 7
38 8 39 9 3A : 3B ;
3C < 3D = 3E > 3F ?
40 @ 41 A 42 B 43 C
44 D 45 E 46 F 47 G
48 H 49 I 4A J 4B K
4C L 4D M 4E N 4F O
50 P 51 Q 52 R 53 S
54 T 55 U 56 V 57 W
58 X 59 Y 5A Z 5B [
5C \ 5D ] 5E ^ 5F _
60 ` 61 a 62 b 63 c
64 d 65 e 66 f 67 g
68 h 69 i 6A j 6B k
6C l 6D m 6E n 6F o
70 p 71 q 72 r 73 s
74 t 75 u 76 v 77 w
78 x 79 y 7A z 7B {
7C | 7D } 7E ~ 7F DEL

Use the ASCII table; find the hexadecimal and Binary values corresponding to your full name (note that there are spaces in the string); answer the following:

a. Your full name in Hexadecimal16

  • Jack Darlington =
  • 4A 61 63 6B 20 44 61 72 6C 69 6E 67 74 6F 6E

b. How many bits are used (do not count the end of the string byte)

  • Jack Darlington = 15 characters
  • One byte per character
  • 15 bytes or 120 bits
  • ASCII Hexadecimal Binary
    J 4A 0100 1010
    a 61 0110 0001
    c 63 0110 0011
    k 6B 0110 1011
    20 0010 0000
    D 44 0100 0100
    a 61 0110 0001
    r 72 0111 0010
    l 6C 0110 1100
    i 69 0110 1001
    n 6E 0110 1110
    g 67 0110 0111
    t 74 0111 0100
    o 6F 0110 1111
    n 6E 0110 1110