1.45k likes | 3.51k Views
Binary Numbers. 10010110101011000110. Introduction. Binary is a base-2 number system. This means that each digit can only be one of two values (0-1). Standard Decimal is a base-10 number system (0-9).
E N D
Binary Numbers 10010110101011000110
Introduction • Binary is a base-2 number system. • This means that each digit can only be one of two values (0-1). • Standard Decimal is a base-10 number system (0-9). • Binary numbers are used in computer circuits because transistors can only be on (1) or off (0). • A single digit in binary is called a bit.
Representation in Binary • Because binary is a base-2 number system, each bit represents an increasing power of two. • The rightmost bit starts with a power of zero and increases by one when moving to the left.
Converting from Binary • Find each bit’s respective power of two. • Multiply each bit by this respective power. • The decimal value will equal the sum of these multiplications.
Converting to Binary • Take the decimal number you want to convert and divide it by two. Record the quotient and remainder. • Take the quotient and divide it by two again and record the new quotient and remainder. Repeat this step until the quotient is 1 or 0. • The binary value will equal the final quotient with all of the remainders appended, starting from the bottom and moving up.
Carry Bits • When the sum of any number of bits exceeds the maximum number a bit can hold (1), a carry bit must be used to handle the overflow. • This carried bit is used in the next bit to the left. • Carry bits are used primarily in addition.
Binary Addition • Addition in binary is similar to standard decimal addition, typically requiring carrying. • You add the bits of each column starting at the right side then moving left. • Any carry bits are used in the addition of the next column.
2’s Complement • There is no negative sign in binary so a method called 2’s complement is used to represent negative numbers. • There are two steps: • Complement each bit (1 becomes 0 and 0 becomes 1). • Add 1 to get the result.
Binary Subtraction • Because subtraction is the addition of a negative number, binary subtraction is the addition of a 2’s complemented number. • Find the 2’s complement of the number you want to subtract, then add it to the number you want to subtract it from. • After the addition, any remaining carry bits must be ignored.
Counting Reference Guide • 0 = 0000 • 1 = 0001 • 2 = 0010 • 3 = 0011 • 4 = 0100 • 5 = 0101 • 6 = 0110 • 7 = 0111 • 8 = 1000 • 9 = 1001 • 10 = 1010 • 11 = 1011 • 12 = 1100 • 13 = 1101 • 14 = 1110 • 15 = 1111 Notice how each column alternates in a pattern when counting in order.