Day 1 and 2 Flashcards
Base
indicates how many values a single digit can take
How many bits in a nibble, byte, word, double word, quad word
nibble = 4 bits byte = 8 bits word = 16 bits double word = 32 bits quad word = 64 bits
Positional notation
each place within a number system carries a different weight.
makes basic math intuitive
How do you convert any base to a decimal?
MADD [multiply then add]
OCTAL = 1, 8, 64, 512, 4096
HEX = 1, 16, 256, 4096
How do you convert any decimal to a base?
by dividing then subtracting
How do you convert using grouping?
hex = 1, 2, 4, 8
oct = 1, 2, 4
What is an unsigned integer?
whole numbers as an absolute value. Commonly found in 16, 32, 64 bit sizes.
Shift logical left (SHL)
moves n bits in binary to the left and clears each empty bit.
Shift logical right (SHR)
moves n bits in binary to the right and clears each empty bit.
Signed integers
are whole number with a sign and are respresented in 2’s complement format.
Shift arithmetic left (SAL)
multiplies by moving n bits in the value to the left and clearing each empty bit while preserving the sign bit.
Shift arithmetic right (SAR)
divides by moving n bits in binary to the right and setting each empty bit to the same sign as the sign bit, each time preserving the sign bit.
2 rules: pad with sign bit and save sign bit***
Integer Overflow Vulnerability
occurs when a whole number is too large to be stored in the number of bits available. A carry out usually indicates an overflow. Check if the carry into the sign bit is different from the carry out of the sign bit.
Floating-point number
is a real number. In 1985, institute of electrical and electronics engineers created 1EEE 754.
What is the ASCII and Unicode
encoding method to convert 1s and 0s to human- readable characters.
7-bit ASCII
represents Latin alphabet. seven bits for code and eight bit is parity.