Looks like no one added any tags here yet for you.
Bit
A bit is the smallest unit of data in computing. It is a binary digit that can hold either the value of 0 or 1.
Byte
A byte is a group of binary digits operated on as a unit. In most computer systems, a byte is made up of 8 bits.
Word
A word is the total number of bits that can be manipulated as a single unit by the CPU.
Boolean
A Boolean data type represents truth values and can only take on two possible values: true or false.
May be stored in a single Bit as 1 if true and 0 if false.
Character
A character data type is used to store a single character, such as a letter, digit, or symbol. Characters are often represented using character encoding standards like ASCII or Unicode.
ASCII Character: 1 byte (8 bits). ASCII characters range from 0 to 127.
String
A string is a sequence of characters used to represent text. Unlike single characters, strings can vary in length.
The storage requirement for a string depends on its length and the encoding used.
For example, a string of length nnn in ASCII would require nnn bytes.
Integer
An integer data type is used to store whole numbers (i.e., numbers without a fractional part). Integers can be signed (allowing negative values) or unsigned (positive values only).
The storage requirement is 8-bit (1 byte) Integer: Ranges from −128-128−128 to 127127127 (signed) or 000 to 255255255 (unsigned).
Real
A real (or floating-point) data type is used to represent numbers with fractional parts, allowing for the representation of decimal points.
The storage requirement is 32-bit(4 bytes)
Overflow error
An overflow error occurs when a binary value is too large to be stored in the bits available. (e.g., 128 for an 8-bit value)
Underflow error
An underflow error occurs when a number is too small to be stored in the bits available. e.g., 0.00005 for a 3-bit value
How to calculate absolute error
Absolute = original - new
How to calculate relative error
Relative = (absolute/original) * 100
Positive Whole Numbers (base 10) in Binary
The example in the picture represents 42 in 8-bit binary.
When representing a positive number in binary, it always starts from 0.
42 -> 00101010
This is wasteful, as zero can be represented twice
Negative Whole Numbers (base 10) in Binary
The example in the picture represents -42 in 8-bit binary.
When representing a negative number in binary, it always starts from 1.
-42 -> 11010110
2's Complement
Method for representing signed (positive, negative, and zero) integers.
-42 -> 11010110 (in two's complements)
-128+64+16+4+2 = -42
Arithmetic and Logical Left-shift of binary
Left-shift means you are multiplying the binary by 2
In Arithmetic left-shift, if the binary starts with 1 that is, it's minus, you will keep the minus when you left shift.
Example: -42 -> 11010110 will be become 10101100
-128+32+8+4 = -84
In Logical left-shift, if the binary starts with 1, it will become 0, that is, the binary will become positive.
Example: -42 -> 11010110 will become 01010100
64+16+4 = 84
Arithmetic and Logical Right-shift of binary
Right-shift means you are dividing the binary by 2
In Arithmetic right-shift, if the binary starts with 1 that is, it's minus, you will keep the minus when you left shift.
Example: -42 -> 1101011 will be become 11101011
-128+64+32+8+2+1 = -21
In Logical right-shift, if the binary starts with 1, it will become 0, that is, the binary will become positive.
Example: -42 -> 11010110 will become 00010101
16+4+1 = 21
Real Numbers
Numbers with decimal places like 2.5 or 3.141592654
Standard Form
Large numbers represented as Mantissa x 10^exponent
0.65625 X 2^6 represent 42
Exponent and Mantissa
Mantissa x 10^exponent
Mantissa must be between 0.5 and 1
0.5 <= Mantissa < 1
Exponent is part of a number indicating the power of the base
How to get exponent and mantissa
You will use a calculator to divide the number by 2 each time until you get an answer that's between 0.5 and 1. The answer is the mantissa. The number of 2 you use to get the answer is the exponent.
42 = 42 x 2^0 (no division)
42 = 21 x 2^2 (first division)
42 = 10.5 x 2^2 (second division)
42 = 5.25 x 2^3 (third division)
42 = 2.625 x 2^4 (fourth division)
42 = 1.3125 x 2^5 (fifth division)
42 = 0.65625 x 2^6 (sixth division)
16-bit Floating Point
16-bit floating point uses 8-bits for the Mantissa and 8-bits for the Exponent.
Both parts could use Sign & Magnitude or Two's Complement representation.
Representing Mantissa in binary
The image show how to represent a Mantissa of 0.65625
Representing Exponent in binary
The image show how to represent an exponent of 6
16 bit floating point representation
Real Number to fixed point binary
The image shows 25.57 in fixed point binary.
Convert the 25 to binary, then convert .75 using 1/2, 1/4 and so on.
Difference between Floating Point and Fixed Point
Floating point
• It has set number of bits for mantissa and exponent
• trade-off between accuracy v range
• larger mantissa leads to greater accuracy
• larger exponent leading to greater range of numbers being represented
• It is not possible to represent zero.
Fixed point
• not flexible and has a set range and level of accuracy
• is less complex.
Hexadecimal (HEX)
Hexadecimal is base-16
There are 16 different characters available when using this system:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
A - 10
B -11
C - 12
D - 13
E - 14
F -15
Hex to denary (base 10)
AD9C
(10 x 4096) + (13 x 256) + (9 x 16) + (12 x 1)
40960 + 3328 + 144 + 12 = 44444
Base 10 to Hex
50672
50672/4096 = 12 - C
12 x 4096 = 49152
50672 - 49152 = 1520
1520/256 = 5 - 5
5 x 256 = 1280
1520 -1280 = 240
240/16 = 15 - F
15 x 16 = 240
240 - 240 = 0 - 0
50672 -> C5F0
Binary to Hex
10101101111011
Split into group of four
0010 1011 0111 1011
2B7B
When splitting up the Binary into group of 4, always start at the RIGHT