1.1 - number systems ๐ข Flashcards
to learn how to perform operations with binary and hexadecimal numbers + convert between number systems
which number is binary based on?
2
which number is denary based on?
10
which number is hexadecimal based on?
16
how can numbers be converted from binary to denary?
by multiplying the 1-values with their headings and adding them up (eg. 1101 -> (18)+(14)+(02)+(11) = 8 + 4 + 1 = 13)
how can numbers be converted from denary to binary?
by successively dividing them by 2 (eg. 120 / 2 = 60R0 / 2 = 30R0 / 2 = 15R0 / 2 = 7R1 / 2 = 3R1 / 2 = 1R1 / 2 = 0R1 -> 1111000)
how can numbers be converted from binary to hexadecimal?
by splitting a binary number into fragments of 4 bits and then determining those fragmentsโ values (eg. 00110100 -> 1011 0100 -> 11 and 4 -> B4)
how can numbers be converted from hexadecimal to binary?
by first converting the hexadecimal digits into 4-bit binary numbers and then combining them into a single 8-bit number (eg. 9D -> 9 and 13 -> 1001 1101 -> 10111101
how are MAC addresses (hexadecimal network device identifiers) formatted?
as MM:MM:MM:SS:SS:SS or MM-MM-MM-SS-SS-SS (M = manufacturer ID, S = device serial number)
what are some examples of manufacturer IDs in MAC addresses?
94:BF:2D (Apple), 9C:7B:EF (HP), A0:91:A2 (OnePlus)
how are IPv4 addresses formatted?
as either xxx.xxx.xxx.xxx (denary) or xx.xx.xx.xx (32-bit hexadecimal)
how are IPv6 addresses formatted?
as xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx (64-bit hexadecimal)
what are hexadecimal error codes used for?
to identify randomly-generated memory locations (eg. E00 -> 1110 0000 0000)
what do the hexadecimal numbers in HTML color codes stand for?
RGB values (eg. #FF0000 -> R255 G0 B0)
whatโs an overflow error?
when there are more bits in a binary value than a device can allow for (eg. generating a 33-bit binary value when the maximum number of bits is 32 causes an overflow error)
how do logical shifts work?
they either multiply binary numbers by 2 (when done to the left) or divide them by that same number (when done to the right)
whatโs different in twoโs compliment mode?
the leftmost bit determines the numberโs sign (0 = positive, 1 = negative)
how do you convert negative denary numbers into binary?
by writing the denary valueโs positive counterpart in binary, inverting all the bits, and adding 1 to the result
(C1) convert the denary number 98 into binary without using a calculator
01100010
(C2) convert the non-twoโs complement binary number 10010010 into denary without using a calculator
146
(C3) convert the hexadecimal number E04 into binary without using a calculator
1110 0000 0100
(C4) convert the binary number 0101 0101 into hexadecimal without using a calculator
55
(C5) convert the hexadecimal number F4 into denary without using a calculator
244
(C6) convert the denary number 39 into hexadecimal without using a calculator
27 because 39 in binary = 0010 1001
(C7) logically shift the binary number 00100101 (37 in denary) to the left and work out its value without using a calculator
01001010 (74 in denary - the original value was multiplied by 2)
(C8) convert the denary number -101 to twoโs complement-format binary without using a calculator
+101 = 01100101 in binary so flipping the digits turns this into 10100110 and adding 1 turns this into the final answer of 10100111