Digital technology and semiconductor circuit design

Number representation WebApp

Number systems serve to display numbers by means of suitable digits and their systematic arrangement. In polyadic number systems, the valency of a symbol depends on its position. The composition of such a system can be represented formally with $$ N = \sum\limits_{i=0}^n a_i \cdot b^i = a_n \cdot b^n + \dots + a_1 \cdot b^1 + a_0 \cdot b^0 $$ whereby \(b\) is the basis and \(a_i\) are the digits of the displayed number \(N\).

From the decimal system to the basis \(b\)

For the conversion of a number \(N=\) from the decimal system into the system with the basis of \(b=\) , the number must be divided by the basis of \(b\) for multiple times.

The divisions' rests from bottom to top result in the number to be displayed:

Back to the decimal system

For the conversion of a number \(N_b=\) from the number system with the basis \(b=\) into the decimal system, the coefficients have to be multiplied and added up with the respective potency.

The sum is

Two's Complement Representation

For the represenation of negative numbers, without a sign's help, various formats can be applied. (see WebApp about negative numbers) In computer centers, usually the two's complement is used, since it can be realized very simply. Formally, a number in the 2's complement can be written as follows: $$ N = a_{n-1} \dots a_1 a_0 = - a_{n-1} \cdot 2^{n-1} + \sum\limits_{i=0}^{n-2} a_i \cdot 2^i $$ Usually, the number of Bits (n = ) used and the available value range \([-2^{n-1}, 2^{n-1}-1]\) i.e. \(\) is determined. The total amount of a number \(N=\) is firstly converted into its binary represenation (1111011). The 2's complement is obtained by inverting all bits and then adding an LSB (least significant bit).

Number in 2's complement representation:

The backwards calculation is done according to the above-equation through summing up the potencies \(a_{i}\cdot b^i\) für \(i=0,\dots,n-2\) and (if applicable) subtraction of the highest potency \(\).

Die Summe ergibt:

Fixed point format (pure fractional numbers)

A number \(x\) with \(|x| \leq 1\) can be written according to the following formula in the binary system: $$ x = a_{n-1}\bullet a_{n-2}\dots a_1 a_0 \\ = -a_{n-1}\cdot 2^0 + \sum\limits_{i=1}^{n-1}a_{n-1-i}\cdot 2^{-i} $$ Typically the number of bits \(n = \) and hence the resolution is fixed. In that way, numbers can be mapped in the range analogous to the 2's complement \([-1, 1-2^{-(n-1)}]\) i.e. \([-1, 0.875]\). The conversion of a number \(x = \) is done by a repeated multiplication by 2.

Reading from top to bottom, the decimal places of the binary representation are shown:
The conversion of the negative number occurs analogously to the 2's complement.