CS1 Flashcards
Denary to binary
Successive or subtraction
Binary to decimal
Replaces ones with places and add
Binary addition
In binary addition change the 0 to a 1 if there is already a 1 then move that 1 to the left position
Hexadecimal
0 1 2 3 4 5 6 7 8 9 a b c d e f
Hexadecimal to decimal
Use values to convert and then add all
Decimal to hexadecimal
Divide number by 16 then take the result of the final subtraction as the remeinder, repeat as much times as possible
Hexadecimal advantages
Shortcut to represent binary numbers
Two hex digits make 1 byte (8 bits)
Hexadecimal are used in colors, error messages, assembly languages programs, MAC addresses
Hexadecimal to binary
Separate the hexadecimal number by digits and then get the nibble then just write them together
Binary to hexadecimal
Separate the binary into nibbles and then convert those nibbles and write together
Storage units
8 bits = 1 byte (x1000) 1000 bytes = 1 Kilobyte 1,000,000 bytes = 1 Megabyte 1,000,000,000 bytes = 1 Gigabyte 1,000,000,000,000 bytes = Terabytes
Overflow
An overflow error occurs when a value outside this limit should be returned, this means that the largest number that a register can hold is exceeded.
An overflow error will occur if the value is greater than 255 in an 8-bit register
Shifts
Multiplications or divisions
2^0 = 1 shift = x or / 1 2^1 = 2 shifts = x or / 2 2^2 = 3 shifts = x or / 4
Multiplication
Are left shifts, after shifting a zero is added to the right, if a 1 exceeds the limit then it will cause and overflow and we can loose data.
Division
Are right shifts, after shifting a zero is added to the left, a 1 bit can be lost, it doesn’t cause and overflow, but it loses accuracy.
What do you use to get negative binary numbers
Two’s complement