| D num | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1024 | 512 | 256 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | |
| 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | Answer150 |
| 1 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | Answer1754 |
| 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | Answer1365 |
| 1024 | 512 | 256 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |

| Decimal | Quotient | Remainder (Binary) |
|---|---|---|
| 61 | - | - |
| 30 | 30 | 1 |
| 15 | 15 | 0 |
| 7 | 7 | 1 |
| 3 | 3 | 1 |
| 1 | 1 | 1 |
| 0 | - | - |
So, 61 in decimal is 111101 in binary.
| 16777216 | 1048576 | 65536 | 4096 | 256 | 16 | 1 |
| Binary | ||||||||
|---|---|---|---|---|---|---|---|---|
| Unsigned Int | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 |
| Hexadecimal | F | E | D | C | B | A | 9 | 8 |
| Binary | ||||||||
|---|---|---|---|---|---|---|---|---|
| Unsigned Int | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Hexadecimal | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
Break the binary number into groups of 4 binary digits, why Answer
Each group represnt values from 0-15 (F)
| Binary | Grouped Bits | Hexadecimal |
|---|---|---|
| 11111011 | 1111 1011 | AnswerFB |
| 00011010 | 0001 1010 | Answer1A |
In hex each position's weight should be 16 times the previous.
|
|
|
The conversion can be done between 1 and 4 hexadecimal positions, much like Hexadecimal
|
Big Endian =Answer
Little Endian =Answer
Computers use numeric encodings to represent character data inside the memory of the machine, in which each character is assigned an integral value.
Character codes, however, are not very useful unless they are standardised. When different computer manufacturers use different coding sequence (as was indeed the case in the early years), it is harder to share such data across machines.
The first widely adopted character encoding was ASCII (American Standard Code for Information Interchange).
ASCII Table
| Dec | Char | Dec | Char | Dec | Char | Dec | Char | Dec | Char | Dec | Char | Dec | Char | Dec | Char |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 32 | SPACE | 45 | - | 58 | : | 71 | G | 84 | T | 97 | a | 110 | n | 123 | { |
| 33 | ! | 46 | . | 59 | ; | 72 | H | 85 | U | 98 | b | 111 | o | 124 | |
| 34 | " | 47 | / | 60 | < | 73 | I | 86 | V | 99 | c | 112 | p | 125 | } |
| 35 | # | 48 | 0 | 61 | = | 74 | J | 87 | W | 100 | d | 113 | q | 126 | ~ |
| 36 | $ | 49 | 1 | 62 | > | 75 | K | 88 | X | 101 | e | 114 | r | 127 | DEL |
| 37 | % | 50 | 2 | 63 | ? | 76 | L | 89 | Y | 102 | f | 115 | s | ||
| 38 | & | 51 | 3 | 64 | @ | 77 | M | 90 | Z | 103 | g | 116 | t | ||
| 39 | ' | 52 | 4 | 65 | A | 78 | N | 91 | [ | 104 | h | 117 | u | ||
| 40 | ( | 53 | 5 | 66 | B | 79 | O | 92 | \ | 105 | i | 118 | v | ||
| 41 | ) | 54 | 6 | 67 | C | 80 | P | 93 | ] | 106 | j | 119 | w | ||
| 42 | * | 55 | 7 | 68 | D | 81 | Q | 94 | ^ | 107 | k | 120 | x | ||
| 43 | + | 56 | 8 | 69 | E | 82 | R | 95 | _ | 108 | l | 121 | y | ||
| 44 | , | 57 | 9 | 70 | F | 83 | S | 96 | ` | 109 | m | 122 | z |
Can 256-character codes accommodate all the characters in other languages, e.g., Chinese, Japanese, Greek, etc.?
| Type | Value |
|---|---|
| ASCII | 41h |
| Unicode | 4100h |
Fundamentally, binary is electrical signals represented as 1 or 0, a sequence of eight is mapped to the decimal number which in turn is mapped to a ASCII symbol.
| 00100001 = 33 = ! |
|
*take note, these last 3 slides are helpful for the practical part of the assignment.
In addition to your lectures in Mathematics in Computer Science (For Business students, please get in touch with me if you need more help and support, and I will be happy to set up tutorials), I'm providing an extra lab for you to work on in your own time
--- ## Binary <div align=center> |Decimal | Binary||Decimal|Binary |---|---|----|---|---| |0|000000||10|001010| |1|000001||11|001011| |2|000010||12|001100| |3|000011||13|001101| |4|000100||14|001110| |5|000101||15|001111| |6|000110||16|001000| |7|000111||17|010001| |8|001000||...|...| |9|001001||63|111111| </div>
Therefore the decimal equivalent value is: $$ \begin{aligned} 1 \cdot 2^7 &= 128_{10}\\ 1 \cdot 2^4 &= \hspace{0.5em}16_{10} \\ 1 \cdot 2^2 &= \hspace{1em} 4_{10} \\ 1 \cdot 2^1 &= \hspace{1em} 2_{10} \hspace{0.5em}+ \\ \hline [0]000 \ 1001 \ 0110_2 &\equiv 150_{10} \end{aligned} $$

1. Second lab is all in `c` and we will be writing a program to convert: Lab [here]() - decimal $\longleftrightarrow$ binary - binary $\longleftrightarrow$ hex - hex $\longleftrightarrow$ decimal We may not get through all of this today, luckily for you have 50hrs of self learning for this module.