Chapter 1 : Number Base System Flashcards

1
Q

What is Decimal also called?

A
  1. Base 10
  2. Denary

Binary -> Base 2
Octal -> Base 8
Hexadecimal -> Base 16

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

1 byte how many bits?

A

8 bits

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

How to convert from Decimal to Binary?

A
  1. Integer
    • Repeat division 2
    • No Remainder ( 0 )
    • Remainder ( 1 ) , 0.5
  2. Fraction
    • Repeat multiplication 2
    • Need to be 0. ( 0.7 )

0.25 x 2 = 0.5 - 0
0.5 x 2 = 1 - 1 ( Top to Bottom )

Ans : 0.01

17
17 / 2 = 8.5 - 1
8 / 2 = 4 - 0
4 / 2 = 2 - 0
2 / 2 = 1 - 0
1 / 2 = 0.5 - 1 ( Bottom to Top )

Ans : 10001

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

How to convert from Decimal to Octal?

A
  1. Integer
    • Repeat division 8
    • No Remainder ( 0 )
    • Remainder ( Remainder )
  2. Fraction
    • Repeat multiplication 8
    • Need to be 0. ( 0.7 )

0.25 x 8 = 2 - 2 ( Top to Bottom )

Ans : 0.2

17
17 / 8 = 2.125 - 1
2 - 2 ( Bottom to Top )

Ans : 21

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

How to convert from Decimal to Hexadecimal?

A
  1. Integer
    • Repeat division 16
    • No Remainder ( 0 )
    • Remainder ( Remainder )
  2. Fraction
    • Repeat multiplication 16
    • Need to be 0. ( 0.7 )

0.25 x 16 = 4 - 4 ( Top to Bottom )

Ans : 0.4

17
17 / 16 = 1 - 1 ( Bottom to Top )
1 - 1
Ans : 11

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

What are the rules when converting floating point?

A
  1. When there is whole number after multiplying, stop to process and write down answers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How to calculate from binary to decimal?

A
  1. Integer
    • Repeat multiplication 2
  2. Fraction
    • Repeat division 2

0.101 x 2 = ( 1 x 2^-1 ) + ( 1 x 2^-3 )
= 0.625

Ans : 0.625

1101
1 x 2^3 = 8
1 x 2^2 = 4
1 X 2^0 = 1

Ans : 13

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

How to calculate from octal to decimal?

A
  1. Integer
    • Repeat multiplication 8
  2. Fraction
    • Repeat division 8

0.706 x 8 = ( 7 x 8^-1 ) + ( 6 x 8^-3 )
= 0.89

Ans : 0.89

706
7 x 8^2 = 448
0 x 8^1 = 0
6 X 8^0 = 6

Ans : 454

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

How to calculate from hexadecimal to decimal?

A
  1. Integer
    • Repeat multiplication 16
  2. Fraction
    • Repeat division 16

0.A1B x 8 = ( 10 x 16^-1 ) + ( 1 x 16^-2) + ( 11 x 16^-3 )
= 0.63

Ans : 0.63

A1B ( 10 - A , 11 - B )
10 x 16^2 = 2560
1 x 16^1 = 16
11 X 16^0 = 11

Ans : 2587

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

How to convert octal to binary?

A
  1. Use 4 2 1

753

4 2 1
1 1 1 = 7
1 0 1 = 5
0 1 1 = 3

Ans: 111101011

0.753

Ans : 0.111101011

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

How to convert binary to octal?

A
  1. Use 4 2 1

10 111 111

010 111 111 ( Add 0 in front when it doesn’t match 4 2 1 )

421
010 = 2
111 = 7
111 = 7

Ans = 277

0.10111111

Ans = 0.277

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

How to convert hexadecimal to binary?

A
  1. Use 8 4 2 1

753

8 4 2 1
0 1 1 1 = 7
0 1 0 1 = 5
0 0 1 1 = 3

Ans: 11101010011

0.753

Ans : 0.11101010011

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

How to convert from binary to hexadecimal?

A
  1. Use 8 4 2 1

1010 1011 1100

8 4 2 1
1 0 1 0 = A ( 10 )
1 0 1 1 = B ( 11 )
1 1 0 0 = C ( 12 )

Ans: ABC

0.101010111100

Ans : 0.ABC

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

How to convert from Octal to Hexadecimal?

A
  1. Use 4 2 1 to convert to binary then use 8 4 2 1 to convert to hexadecimal

1076 ( Octal )

4 2 1
0 0 1 = 1
0 0 0 = 0
1 1 1 = 7
1 1 0 = 6

10 0011 1110
0010 0011 1110

8 4 2 1
0 0 1 0 = 2
0 0 1 1 = 3
1 1 1 0 = E

Ans : 23E

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

How to convert from Hexadecimal to Octal?

A
  1. Use 8 4 2 1 to convert to binary then use 4 2 1 to convert to octal

1F0C ( Hexadecimal )

8 4 2 1
0 0 0 1 = 1
1 1 1 1 = F
0 0 0 0 = 0
1 1 0 0 = C

1111100001100
001 111 100 001 100

4 2 1
0 0 1 = 1
1 1 1 = 7
1 0 0 = 4
0 0 1 = 1
1 0 0 = 4

Ans 17414

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

How to do binary addition?

A

Rules
1 + 0 =1
1 + 1 =10
1 + 1 + 1 =11 ( 1 + C , Carry )

Examples
CCC
1011
+ 1111
10010

17
Q

How to do binary subtraction?

A

Rule
Borrow 2 from the front
0 1 2 0 1 . 1 2
1 1 0 0 1 0 . 0 0
– 1 0 1 . 1 1
1 0 1 1 0 0 . 0 1

18
Q

How to do Octal Addition

A

Rule
** - 8 **and **carry 1 ** to the font when the number is bigger than 7

Example
C
4 4 7
+ 6 2 2
1 2 7 1

9 - 8 =1
10 -8 =2

19
Q

How to do Octal Subtraction?

A
  1. Carry 1 from font numbers when there is not enough number to deduct

Example
4 7 7 12 2 8
5 0 0 4 . 3 0
- 2 6 7 . 1 4

20
Q

How to do hexadecimal addition?

A
  1. If sum exceeds 15 , subtract with 16 and carrying 1 to the next column

Example
1 1
B 8 3
+ A 2 D
1 5 B 0
3 + D = 16 -16 = 0 + Carry
8 + 2 + 1 = 11 ( B )
A + B = 10 + 11 = 21 - 16 = 5 + Carry

21
Q

How to do hexadecimal subtraction?

A
  1. Borrow 16 from the font numbers

Example
9 15 20 22 . 2 16
A 0 4 7 . 3 0
- B 5 8 . 4 1
9 4 F E . E F

22
Q

List out 3 methods for positive and negative numbers data representation ( 3 )

A
  1. Sign and Magnitude
  2. 1’s Complement
  3. 2’s Complement
23
Q

How to view sign and magnitude?

A
  1. The 1st bit is sign
    • 0 is positive
    • 1 is negative
  2. Remaining bits represent the magnitude

Example
5 = 101
+ 5 = 0101
- 5 = 1101

24
Q

What are the disadvantages of Sign & Magnitude? ( 2 )

A
  1. There are 2 representations (00000000 and 10000000) for the number 0 , which could lead to inefficiency and confusion.
  2. Positive and negative integers need to be processed separately
25
Q

What is the difference in 1’s / 2’s Complements Positive values compared with binary?

A
  1. Same as binary

5 = 0101
+ 5 = 0101 ( Same as Binary )
- 5 = 1010 ( -ve will use the 1 to 0 , 0 to 1 method )

26
Q

How to calculate 1’s complement?

A
  1. Change 1 to 0 , 0 to 1 when the number is negative
  • 5 = 1010 ( -ve will use the 1 to 0 , 0 to 1 method )
27
Q

What is the disadvantages of 1’s Complement?

A
  1. Difficulty in making comparisons and additional complexity involved in
    adding numbers.
  • Not commonly used
28
Q

How to convert values to decimal, binary, octal, hex in calculator?

A
  1. Mode 2
  2. Base 3
  3. Type something in decimal
  4. Press Shift + HEX / BIN / OCT
29
Q

How to calculate 2’s Complement?

A
  1. Check if it was negative value
  2. Do 1’s Complement
  3. Add 1 to the answer of 1’s Complement

Example
-6 in 4 bit using 2’s Complement

6 = 0110
-6 = -0110
= 1001 ( 1’s Complement )
= 1001 + 1
= 1010 ( 2’s Complement )

30
Q

What are the method introducted for floating point representation?

A
  1. IEEE Standard for Floating-Point Arithmetic ( IEEE 754 )
31
Q

What are the bits range for sign, exponent and mantissa for 8-bit floating point representation ?

A
  1. Sign - 1 bit
  2. Exponent - 3 bit
  3. Mantissa - 4 bit
32
Q

What are the bits range for sign, exponent and mantissa for 16-bit floating point representation ?

A
  1. Sign - 1 bit
  2. Exponent - 6 bit
  3. Mantissa - 9 bit
33
Q

What are the bits range for sign, exponent and mantissa for 32-bit floating point representation ?

A
  1. Sign - 1 bit
  2. Exponent - 8 bit
  3. Mantissa - 23 bit
34
Q

List out ways to convert from decimal to floating point conversion (

A
  1. Convert from decimal to binary
  2. Do normalization
    • Let the radix point falls to the right of the leftmost 1 bit
    • 111.101 = 1.11101 x 2^2
    • 0.0101 = 1.01 x 2^-2 ( Move to right )
  3. Do sign
    • If decimal is positive , it was 0, if it was negative, it was 1
  4. Do exponent
    • Add the exponent with the bias
    • 2^1 = 1 + 3 = 4 = 100
    • Add 0 to the left
  5. Do mantissa
    • Pick value from 1. { 11101} x 2^2
    • 11101
    • Add 0 to the right it the bits isn’t enought
    • 111010
  6. Place the answers together with the sequence
    • Sign , Exponent , Mantissa
35
Q

What position to add 0 when the bits isn’t enough?
1. Exponent
2. Mantissa

A
  1. Exponent - To the left
  2. Mantissa - To the right
36
Q

How to convert from floating point to decimal?

A
  1. Formula
    ( -1 )^s x ( 1 + M ) x 2 ^ E - B

Example
Convert 8 bit floating point 11100111 with 3 bits exponent with 3 bits bias
Sign - 1
Exponent - 110
Mantissa - 0111

M = 2^-2 + 2^-3 + 2^-4
Exponent = 110 = 6

= ( -1 ) ^1 x ( 1 + 2^-2 + 2^-3 + 2^-4 ) x 2^6 - 3
= -1 x 1.4375 x 2^3
= -11.5