Notes From CS Undergrad Courses FSU
This project is maintained by awa03
We use the decimal numbering system (base 10) in our everyday lives. This can be seen below:
$$632 = (100 * 6) + (10 * 3) + (1*2)$$
This may be seen through the formula $$\sum^2_{i=0}d_i = dn * 10^n + dn_{-110^{n-1+...}}d_110^1+d_0*10^0$$
$d_n$ is the most significant digit and $d_0$ is the least significant digit.
In Base X, a non-negative intereger $d_nd_{n-1}...d_1d_0$
$$ \sum^2_{i=0}d_i * Xi = dn * Xn + dn_{-1}X^{n-1+...+}d_1X^1+d_0X^0 $$
cout
converts the binary storage of the number into the requested format
The C language uses specifiers to convert within scanf()
this can be seen in [[C1]]
Base 10 | Base 2 | Base 8 | Base 16 |
---|---|---|---|
0 | 0 | 0 | 0 |
1 | 1 | 1 | 1 |
2 | 10 | 2 | 2 |
3 | 11 | 3 | 3 |
4 | 100 | 4 | 4 |
5 | 101 | 5 | 5 |
6 | 110 | 6 | 6 |
7 | 111 | 7 | 7 |
8 | 1000 | 10 | 8 |
9 | 1001 | 11 | 9 |
10 | 1010 | 12 | A |
11 | 1011 | 13 | B |
[[Computer Science Notes/CDA 3100/Index|Index]]