Number Systems, Operations, and Codes Flashcards

1
Q

Largest decimal number with n bits

A

With n bits, you can count up to a number equal to
(2raise to n) - 1.
Largest decimal number = (2 raise to n) - 1.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Represent fractional bits using binary

A

Fractional numbers can also be represented in binary by placing bits to the right of the
the binary point, just as fractional decimal digits are placed to the right of the binary point.
The left-most bit(after decimal) is the MSB in a binary fractional number and has a weight of 2^(-1) = 1/2 = 0.5[equivalent decimal weight]
The fractional weights decrease from left to right by a negative power of two for each bit.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Binary weight

A

All the bits to the left of the
binary point have weights that are positive powers of two, as previously discussed for whole
numbers. All bits to the right of the binary point have weights that are negative powers of
two, or fractional weights.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Binary-to-Decimal Conversion

A

Add the weights of all 1s in a binary number to get the decimal value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Decimal whole number to binary:

Sum of weights:

A

determine the set of binary weights whose sum is equal to the decimal number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Decimal whole number to binary:

Repeated division by 2:

A
To get the binary number for a given
decimal number, divide the decimal
number by 2 until the quotient is 0.
Remainders form the binary number.
 The first remainder to be produced is the LSB and last one is MSB.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Converting Decimal Fractions to Binary:

Sum-of-Weights

A

The sum-of-weights method can be applied to fractional decimal numbers, as shown:
0.625 = 0.5 + 0.125 = 2^-1 + 2^-3 = 0.101
There is a 1 in the 2^-1
position, a 0 in the 2^-2
position, and a 1 in the 2^-3
position.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Converting Decimal Fractions to Binary:

Repeated Multiplication by 2

A

to convert the decimal fraction 0.3125 to binary, begin by multiplying
0.3125 by 2 and then multiplying each resulting fractional part of the product by 2 until
the fractional product is 0 or until the desired number of decimal places is reached or stop when the fractional part is all zeros.
The carry digits, or carries, generated by the multiplications produce the binary number.
The first carry produced is the MSB, and the last carry is the LSB.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

4 Basic rules of binary addition:

A

0 + 0 = 0 Sum of 0 with a carry of 0
0 + 1 = 1 Sum of 1 with a carry of 0
1 + 0 = 1 Sum of 1 with a carry of 0
1 + 1 = 10 Sum of 0 with a carry of 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Binary addition, carry situation of adding 3 bits:

A

Carry bits
1 + 0 + 0 = 01 Sum of 1 with a carry of 0
1 + 1 + 0 = 10 Sum of 0 with a carry of 1
1 + 0 + 1 = 10 Sum of 0 with a carry of 1
1 + 1 + 1 = 11 Sum of 1 with a carry of 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Binary Subtraction basic rules:

A

0 - 0 = 0
1 - 1 = 0
1 - 0 = 1
10 - 1 = 1 [0 - 1 with a borrow of 1]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Binary Multiplication, 4 basic rules:

A
0 * 0 = 0
 0 * 1 = 0
 1 * 0 = 0
 1 * 1 = 1
Binary multiplication of two bits is
the same as multiplication of the
decimal digits 0 and 1.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Binary Division:

A

Division in binary follows the same procedure as division in decimal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

1’s complement:

A

The 1’s complement of a binary number is found by changing all 1s to 0s and all 0s to 1s. here zero has two representations, 0000 0000 and 1111 1111.. not appreciated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Logical circuit for 1’s complement:

A

Parallel inverters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

2’s complement

A

2’s complement = (1’s complement) + 1
OR the alternative method is:
Change all bits to the left of the least significant 1 to get 2’s complement.
for zero an overflow would occur but that taken care then main 8 bits represent 0.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Logical circuit for 2’s complement:

A

parallel inverters followed by an adder with a carry input [1].

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Get true form (uncomplemented) from 1’s or 2’s complement:

A

Simply repeat what u did to get the complement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Sign Bit

A

It’s the left-most bit in a signed binary number.

A 0 sign bit indicates a +ve number, and a 1 : -ve.

20
Q

Signed numbers:

Sign Magnitude form

A

In the sign-magnitude form, a negative number has the same magnitude bits as the corresponding positive number but the sign bit is a 1 rather than a zero.

21
Q

Signed numbers:

A

1s complement: 1s complement will be the negative number.

2s complement: 2s complement will be the -ve number.

22
Q

The decimal value of signed number in 1s complement form and 2s complement:

A

+ve numbers:
determined by summing the weights in all bit positions where there are 1s.
-ve numbers:
determined by assigning a negative value to the weight of the sign bit, summing all the weights where there are 1s, and
adding 1 to the result.
And in 2s complement same process but no need of adding one to the answer.

23
Q

For 2’s complement signed numbers, the range of values for n-bit numbers is?

A

Range = -( 2^[n-1] ) to +( 2^[n-1] - 1)

[1 sign bit and n-1 magnitude bits]

24
Q

Floating Point Unit

A
  • the coprocessor to free up the CPU (to perform other tasks) and increase speed.
  • Performs complicated math operations using floating point numbers.
25
Q

Single precision
Double precision
Extended precision

A

32bit floating point numbers - Single precision
64 - Double precision
80 - Extended precision

26
Q

Floating point Number.

A

has

  1. Mantissa [ shows magnitude, between 0-1, fractional number]
  2. Exponent [ number of places the point has to move, it’s the power of 10]
27
Q

Overflow

A

When the addition of same signed bits and 7 magnitude bits are not enough to represent the resulting the magnitude it changes the sign bit to adjust and creates an overflow situation.

28
Q

Addition vocab:

A

Addend + augend = sum

29
Q

Subtraction vocab: and function and how to:

A

minuend - subtrahend = difference
Basically, the subtraction operation changes the sign of the subtrahend and adds it to the minuend.
To subtract two signed numbers, take the 2’s complement of the subtrahend and
add. Discard any final carry bit.

30
Q

Multiplication:

sirect addition method only

A
Multiplicand * multiplier = product
Multiplication is equivalent to
adding a number to itself a number
of times equal to the multiplier.
 In the direct addition method, you add the multiplicand a number of
times equal to the multiplier
31
Q

Partial product method multiplication :

just method, not rules.

A

The partial products method is perhaps the more common one because it reflects
the way you multiply longhand. The multiplicand is multiplied by each multiplier digit
beginning with the least significant digit. The result of the multiplication of the multiplicand by a multiplier digit is called a partial product. Each successive partial product
is moved (shifted) one place to the left and when all the partial products have been produced, they are added to get the final product

32
Q

Rules or steps of partial product:

A
  1. if both same sign, product same sign otherwise product sign -.
  2. Make sure numbers in the true or uncomplemented form, negative numbers tend to be in 2s complement form.
    3.Starting with the least significant multiplier bit, generate the partial products.
    When the multiplier bit is 1, the partial product is the same as the multiplicand.
    When the multiplier bit is 0, the partial product is zero. Shift each successive
    partial product one bit to the left.
    4.Add each successive partial product to the sum of the previous partial products
    to get the final product.
    5.If the sign bit that was determined in step 1 is negative, take the 2’s complement of the product. If positive, leave the product in true form. Attach the sign
    bit to the product.
33
Q

Division, whats result and how to get it:

A

Dividend / Divisor = Quotient
the quotient is the number of times that
the divisor will go into the dividend.
Step 1: determine the sign of quotient for the final result, set it to 0, make sure both numbers are in true form.
3. Subtract the divisor from the dividend using 2’s complement addition to get
the first partial remainder and add 1 to the quotient. If this partial remainder is
positive, go to step 3. If the partial remainder is zero or negative, the division
is complete.

34
Q

Hexadecimal

A

Base 16, 0 to F.
Most digital systems process binary data in groups
that are multiples of four bits, making the hexadecimal number very convenient because
each hexadecimal digit represents a 4-bit binary number

35
Q

Binary to Hexadecimal conversion

A

Break the binary number into 4-bit groups, starting at the right-most bit and replace each 4-bit group with the equivalent hexadecimal symbol.

36
Q

Hexadecimal-to-Binary Conversion

A

To convert from a hexadecimal number to a binary number, reverse the process and replace
each hexadecimal symbol with the appropriate four bits.

37
Q

Hexadecimal to decimal:

A

multiply the decimal value of each hexadecimal digit by its weight and then take the sum of these

products. The weights of a hexadecimal number are increasing powers of 16 (from right to
left) .

38
Q

Decimal-to-Hexadecimal Conversion

A

Repeated division of a decimal number by 16 will produce the equivalent hexadecimal
number, formed by the remainders of the divisions. The first remainder produced is the least
significant digit (LSD). Each successive division by 16 yields a remainder that becomes a
digit in the equivalent hexadecimal number.
Note that when a quotient has a fractional part, the fractional part
is multiplied by the divisor to get the remainder.

39
Q

Octal

A

Base 8. 0-7. Each octal digit can be represented by 3 binary bit.

40
Q

Octal to decimal conversion:

A

multiplying each

digit by its weight and summing the products.

41
Q

Decimal to Octal

A

Repeated division by 8.
Each successive division by 8 yields a remainder that becomes a digit in the equivalent octal number. The first remainder generated is the least significant digit (LSD).

42
Q

Octal to Binary:

A

To convert an octal number to a binary number, simply replace each octal digit with the
appropriate three bits.

43
Q

Binary to Octal

A

Start with the right-most group of three bits and,
moving from right to left, convert each 3-bit group to the equivalent octal digit. If there
are not three bits available for the left-most group, add either one or two zeros to make a
complete group. These leading zeros do not affect the value of the binary number.

44
Q

Binary coded decimal

A

A way to represent each of binary digits with binary code. 8421 BCD has a 4 bit value for each decimal.
0: 0000
1: 0001
:
9: 1001
4 bit can form 16 values. Invalid codes are the 6 values we don’t use: 1010, 1011, 1100, 1101, 1110, 1111.

45
Q

BCD to decimal and

decimal to BCD

A

Start at the right-most bit and break the code into groups of four bits. Then write the decimal digit
represented by each 4-bit group.

replace each decimal digit with the
appropriate 4-bit code, to get the BCD.