Assignment title: Information
[3 marks] Perform the following Octal addition directly, without converting to another base.
667
+ 213
----------------
1. [3 marks] Perform the following Hexadecimal addition directly, without converting to another base.
1 0 6 6
+ ABCD
-------------------
2. [4 marks] Given a list of numbers num[0], num[1], …, num[N], write an algorithm in pseudo code to find the Minimum value in the list.
.
3. [4 marks] Briefly explain what Abstraction means. Give two examples (not the erroneous one in the text).
4. [2 marks] What is the lowest base in which 605 would be a valid number?
5. [4 marks] If 11110010 is in 2's complement notation, what signed decimal number does it represent?
6. [5 marks] Convert the decimal number 5.73 to binary. Stop after 4 decimal places. Show your work.
7. [9 marks] Complete the following table. Each row is the same number written in different bases. Each column is the same base. All values are positive.
Binary Octal Decimal Hexadecimal
01100111
53
342
8. [6 marks] Show the behavior of the following circuit by completing the given truth table with the Boolean Expressions and the corresponding truth values
Boolean Expression
A B C
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
Boolean Identities
Property AND OR
Commutative AB = BA A + B = B + A
Associative (AB)C = A(BC) (A + B) + C = A + (B + C)
Distributive A(B + C) = (AB) + (AC) A + (BC) = (A + B)(A + C)
Identity A1 = A A + 0 = A
Complement A(A') = 0 A + (A') = 1
DeMorgan's Law (AB)' = A' + B' (A + B)' = A'B'
Idempotent AA = A A + A = A
Boundedness A0 = 0 A + 1 = 1
Involution (A')' = A
A' means NOT A
9. [6 marks] Simplify the Boolean Expression C(AC)' + BC'A' . Show all the steps.
Character Huffman Code Character Huffman Code
A 00 O 10010
E 11 I 10011
T 010 N 101000
C 0110 F 101001
L 0111 H 101010
S 1000 D 101011
R 1011
10.
a) [2 marks] What word does the following bit sequence represent?
10100100101000010001000010100110110
b) [2 marks] How many bits would it take to represent the word from part a) using ASCII characters assuming that one would use 8 bits per ASCII character?
c) [2 marks] What is the compression ratio between parts a) and b)?
d) [2 marks] Translate the following hexadecimal sequence into English
48 65 78 61 64 65 63 69 6D 61 6C
11. A. [3 marks] Consider the following "Super Simple CPU" program. Does it have a Loop? If it does, circle (or write down) the code that causes a Loop.
B. [5] Trace the code and determine what the final values in Mem[11] (memory location 11), Mem[12], and Mem[13] will be after the program has executed. The original values are given.
TOP LOD 12
SUB 11
JZR XX
JNG YY
STO 12
JMP TOP
XX LDI 1
STO 13
STP
YY STO 13
STP
11 DAT 3
Accumulator Mem[11] Mem[12] Mem[13]
0 3 9 0
12 DAT 9
Original values
Final values
12. [2 mark] What would be in Mem[13] if the original value of Mem[12] was 8.
13. Consider the following truth table for a circuit where A, B, C are the input and X is the sole output.
A B C X
0 0 0 0
0 0 1 0
0 1 0 0
1 0 0 0
0 1 1 0
1 0 1 1
1 1 0 1
1 1 1 1
a) [6 marks] Give a Boolean expression for the circuit and simplify if possible.
b) [4 marks] Draw a circuit implementing this expression using standard logic gate symbols.
14. [4 marks] Describe Two Methods to determine if two distinct circuits are equivalent?
Method 1:
Method 2:
15. [2 marks] The Greek alphabet has 25 symbols. How many bits would be required to represent the Greek alphabet?
Super Simple CPU Instructions Set
1111 STP This stops the computer; no more fetch/decode/execute cycles until you reset.
---------------------------------------------------------------------------------------------------------------------
0001 ADD Fetch a number from memory and add it to the contents of the accumulator, replacing the value in the accumulator. (E.g., 0001000000001111: Get the value at memory location 15 and add that to the accumulator.)
---------------------------------------------------------------------------------------------------------------------
0010 SUB Fetch a number from memory and subtract it from the contents of the accumulator, replacing the value in the accumulator.
---------------------------------------------------------------------------------------------------------------------
0011 LOD Fetch a number from memory and store it in the accumulator, replacing the accumlator's old value. (E.g., 0011000000001111: Get the value at memory location 15 and store that value in the accumulator.)
---------------------------------------------------------------------------------------------------------------------
0100 LDI Load immediate; the value to be put in the accumulator is the operand (the rightmost 12 bits of the instruction); do not go to memory like LOD. (E.g., 0100000000001111: Store the value 15 in the accumulator.)
---------------------------------------------------------------------------------------------------------------------
0101 STO Store the accumulator's value in memory at the indicated location.
(E.g., 0101000000001111: Store the accumulator's value in memory location 15.)
---------------------------------------------------------------------------------------------------------------------
0110 INP Ask the user for one number and store that in the accumulator.
---------------------------------------------------------------------------------------------------------------------
0111 OUT Copy the value in the accumulator to the output area.
---------------------------------------------------------------------------------------------------------------------
1000 JMP Jump to the instruction at the indicated memory address. (E.g.,1000000000001111: Put the value 15 into the PC, which will cause the next instruction to be taken from location 15 of the memory.)
---------------------------------------------------------------------------------------------------------------------
1001 JNG Jump to the instruction at the indicated memory location if the
accumulator's value is negative; otherwise just add 1 to the PC. (E.g., 1001000000001111: Put the value 15 into the PC, if
accumulator < 0; otherwise go to the next instruction.)
---------------------------------------------------------------------------------------------------------------------
1010 JZR Jump to the instruction at the indicated memory location if the
accumulator's value is zero; otherwise just add 1 to the PC. (E.g., 1010000000001111: Put the value 15 into the PC, if accumulator = 0; otherwise go to the next instruction.) Each instruction in this super-simple computer has two parts: opcode and operand
Basic Gates
NOT Gate
AND Gate
OR Gate
XOR Gate
NAND Gate
NOR Gate
ASCII Table
Name/Id_______________________________________________________________
Name/Id_______________________________________________________________