### Task

### Q1

_{16 }

b) Convert the followings:

i) OxBAD into a decimal number

_{10}into a 3-base number

c) Given a (very) tiny computer that has a word size of 6 bits, what are the smallest negative numbers and the largest positive numbers that this computer can represent in each of the following representations?

i) One's complement

### Q2.

## Answers:

### A1

#### a)

To calculate x if (211)_{x} = (6A)_{16}_{ }_{ }_{ }_{ }_{ }...(1)

RHS

We will convert RHS into decimal number system.

(6A)_{16}

= (6 * 16^{1}) + (10 * 16^{0}) (A_{16} = 10_{10})

= (6 * 16) + (10 * 1) (a^{1} = a), (a^{0} = 1)

= 96 + 10

= 106 ...(2)

LHS

We will expand LHS into decimal number system. Since the base is unknown, we will continue with the variable for the time being.

(211)_{x}

= (2 * x^{2}) + (1 * x^{1}) + (1 * x^{0})

= (2x^{2}) + (x) + 1 (a1 = a), (a0 = 1)

= 2x^{2} + x + 1 ...(3)

Using (1), (2), and (3), we get:

2x^{2} + x + 1 = 106

Solving this we get equation, we get x = 7

Thus, the base of 211 is 7 (answer)

### b)

D_{16} = (13)_{16} = (1011)_{2}

A_{16} = (10)_{16} = (1010)_{2}

B_{16} = (11)_{16} = (1101)_{2}

Thus, 0xBAD = (110110101011)_{2}

ii). 588_{10}to base-3.The fundamental process of converting from one base to another is of successively dividing the decimal number by the base of the target number system. The remainders are then collected with the last remainder as the most significant digit, and the first remainder as the least significant digit. This calculation is depicted below:

588 / 3 = 196, remainder = 0

196 / 3 = 65, remainder = 1

65 / 3 = 21, remainder = 2

21 / 3 = 7, remainder = 0

7 / 3 = 2, remainder = 1

2 / 3 = 0, remainder = 2

Thus, the equivalent base-3 number is (210210)_{3}

### c).

We have a computer whose word size is 6 bits. Since we have to accommodate both positive and negative numbers, we need a way to identify this. This identification is done by using the most significant bit (MSB) for representing whether the number is positive, or negative, or by techniques as used in two's complement.

- One's complement.The MSB will be used for storing sign. Thus, we are left with 5 bits. Thus the largest negative number that can be stored is 2
^{5}= -32, and after including 0, the largest positive number that can be stored is 2^{5}- 1 = 31 - Two's complement.In two's complement, the MSB is not used for storing sign, and thus all the bits in the word can be used for storing the data. Thus, the largest negative number is 2
^{6}=-128, and after including 0, the largest positive number is 2^{6}-1 = 127

### A 2

#### a).

The given diagram has the following equation:

AB + ((B+C)BC)

= AB + (BBC + CBC)

= AB + BBC + CBC

= AB + BC + CB

= AB + BC + BC

= AB + BC

= B(A + C)

Thus , the reduced equation can serve the same purpose with two logic gates one AND, and one OR. The logic diagram is as follows:

### b)

We have to prove that ABC + ABC' + AB'C + A'BC = AB + AC +BC. We start with the LHS, and process it as follows:

LHS

ABC + ABC' + AB'C + A'BC

= ABC + ABC + ABC + ABC' + AB'C + A'BC (Using A + A = A, repeating ABC input)

= ABC + ABC' + ABC + AB'C + ABC + A'BC (Using A + B = B + A, rearranging inputs)

= AB(C + C') + AC(B + B') + BC(A + A') (Using A(B+C) = AB + AC, taking common terms out)

= AB(1) + AC(1) + BC(1) (Using A + A' = A, eliminating inputs)

= AB + AC + BC (Using A.1 = A, eliminating inputs)

And this is equal to RHS, thus proved.

## Follow Us