# How many number systems are there

### Number systems

Every number system consists of nominal values. The number of nominal values results from the base.

The largest face value is the base minus (-) 1.

If the highest nominal value is exceeded, the next higher value arises from the carryover.

#### Decimal number system

Nominal values: 0 1 2 3 4 5 6 7 8 9

Base: 10 Largest face value: 9

Place values: 10^{0} = 1, 10^{1} = 10, 10^{2} = 100, etc., so the sequence of digits means 2731

2*10^{3} + 7*10^{2} + 3*10^{1} + 1*10^{0} = 2000 + 700 + 30 + 1 = 2731_{10}.

#### Dual number system

Nominal values: 0 1

Base: 2 Largest face value: 1

Place values: 2^{0} = 1, 2^{1} = 2, 2^{2} = 4, etc., so the sequence of digits 110101 means

1*2^{5} + 1*2^{4} + 0*2^{3} + 1*2^{2} + 0*2^{1} + 1*2^{0} = 32 + 16 + 4 + 1 = 53_{10}.

Exercise: Which decimal value is behind 10101010_{2} ?

#### Hexadecimal number system

Nominal values: 0 1 2 3 4 5 6 7 8 9 A B C D E F

Base: 16 Largest face value: F

Place values: 16^{0} = 1, 16^{1} = 16, 16^{2} = 256, etc., etc., so the sequence of digits 2AF7 means

2*16^{3} + 10*16^{2} + 15*16^{1} + 7*16^{0} = 8192 + 2560 + 240 + 7 =10999_{10}.

Exercise: What is the decimal value behind ABBA_{16} ?

### Overview: nominal value assignment

number | Hexadecimal | Decimal | Binary / dual |
---|---|---|---|

1 | 0 | 0 | 0 |

2 | 1 | 1 | 1 |

3 | 2 | 2 | 10 |

4 | 3 | 3 | 11 |

5 | 4 | 4 | 100 |

6 | 5 | 5 | 101 |

7 | 6 | 6 | 110 |

8 | 7 | 7 | 111 |

9 | 8 | 8 | 1000 |

10 | 9 | 9 | 1001 |

11 | A. | 10 | 1010 |

12 | B. | 11 | 1011 |

13 | C. | 12 | 1100 |

14 | D. | 13 | 1101 |

15 | E. | 14 | 1110 |

16 | F. | 15 | 1111 |

**Conversion between dual system and hexadecimal system **

Converting binary numbers to hexadecimal numbers is very easy, since 16 is a power of two.

Example: Let there be an integer with one byte (= 8 bits):

1 0 1 1 | 1 0 0 1 | (= 185_{10}) |

Since the numbers from 0 to 15 can be represented with four bits, 4 bits correspond in the dual system

a digit in the hexadecimal system. A 4-bit group (half a byte) is also called a "nibble".

Exercise: Convert ABBA_{16 } in the **Dual system** around!

**Calculating in the dual system **

The addition in the dual system works like in any other number system:

It is added in places from the last digit.

If the sum is greater than or equal to the number base in one place,

the "remainder" is entered and a carry-over is noted:

1 0 1 1 0

+ 1 0 1 1

_{1 } _{1 } _{1} <= Transfers

-----------

1 0 0 0 0 1

The subtraction works accordingly, of course.

There is, however, another interesting possibility that we can look to**Number representation in the calculator** leads :

Negative numbers come with a leading **1** represented as a sign bit and coded as follows:

All digits of the corresponding positive number are negated, i.e. 0 becomes 1 and 1 becomes 0.

1 is added to the result. (This representation is called the two's complement.)

Exemplary conversion of the negative decimal number -4 into two's complement for an 8-bit coding:

- Ignore the sign and convert it into the binary system: 4
_{10}= 00000100_{2} - Invert, since negative: 11111011
- Add one because it is negative: 11111011 + 00000001 = 11111100, which means "-4".

Since it is well known that a subtraction can also be replaced by the addition of the negative value,

There is a possibility here of performing subtractions with an adder.

More on that later (full adder).

Addition and subtraction do not require any case distinction. The subtraction is reduced to an addition.

Examples of 8-bit numbers without sign extension:

-4 + 3 = -1 leads to 11111100 + 00000011= 11111111;

+4 +(- 4) = 0:

00000100

+ 11111100

---------

=

**1**00000000

The first one, in this example the 9th digit, is discarded.

+4 - 3 = +1 leads to -4 - 3 = -7 leads to 00000100 11111100 + 11111101 + 11111101 =**1**00000001 =

**1**11111001

Here, too, the correct result is generated by omitting the 9th digit, in these cases 1.

Examples of binary and hexadecimal representations of negative numbers:

+127_{(10)}= 01111111

_{(2)}= 7F

_{(16)}+ 4

_{(10)}= 00000100

_{(2)}= 04

_{(16)}+ 1

_{(10)}= 00000001

_{(2)}= 01

_{(16)}0

_{(10)}= 00000000

_{(2)}= 00

_{(16)}- 1

_{(10)}= 11111111

_{(2)}= FF

_{(16)}- 4

_{(10)}= 11111100

_{(2)}= FC

_{(16)}-127

_{(10)}= 10000001

_{(2)}= 81

_{(16)}-128

_{(10)}= 10000000

_{(2)}= 80

_{(16)}

As long as the valid n-digit number range, for 8-bit numbers the value range of the sum from -128 to +127,

is not exited, this procedure without sign extension works without any problems.

If, on the other hand, the value range of the sum is outside the interval, an overflow occurs, which

in this context it is often and incorrectly confused with the carryover

- What is screaming in Bavarian in Bavaria
- Why do we get excited
- How technologically disabled are you
- What's your rating of Sacramento CA.
- Do people see if I'm scared
- How does the LDS deal with changes in doctrine?
- Why do farmers work so long
- How do fard and wajib differ?
- How has the music industry changed
- When will Japan start accepting immigrants?
- What is the Bloomberg Concept
- What should everyone know about perfumes
- What problems does Dallas TX face
- How many people use zhihu
- Can essential oils relieve back pain
- What is the Planet Fitness dress code
- What are some world problems today
- What makes your parents angry
- Which is the worst state of india
- How many Americans can speak French fluently
- What is the UK General Election
- Can vinegar be used to clean closets
- People still worship Egyptian gods
- Which is the best GCC country