Podcast
Questions and Answers
What is the decimal equivalent of the binary number 101101?
What is the decimal equivalent of the binary number 101101?
- 45 (correct)
- 61
- 53
- 69
What is the result of the binary addition of 1011 + 0110?
What is the result of the binary addition of 1011 + 0110?
- 10000 (correct)
- 11001
- 10001
- 11000
What decimal value does the octal number 72 represent?
What decimal value does the octal number 72 represent?
- 42
- 66
- 50
- 58 (correct)
What is the octal equivalent of the binary number 11010111?
What is the octal equivalent of the binary number 11010111?
Convert the hexadecimal number 2B to its decimal equivalent.
Convert the hexadecimal number 2B to its decimal equivalent.
What is the hexadecimal representation of the decimal number 165?
What is the hexadecimal representation of the decimal number 165?
Convert the binary number 11110000 to hexadecimal.
Convert the binary number 11110000 to hexadecimal.
What is the result of 5 - 3 in binary using two's complement?
What is the result of 5 - 3 in binary using two's complement?
What is the two's complement representation of -25 using 8 bits?
What is the two's complement representation of -25 using 8 bits?
To convert a decimal number to BCD, what is the initial step?
To convert a decimal number to BCD, what is the initial step?
During binary addition, what is the result of 1 + 1?
During binary addition, what is the result of 1 + 1?
Which of the following ranges defines a single digit in octal number system?
Which of the following ranges defines a single digit in octal number system?
What is the main advantage of using hexadecimal numbers in computing?
What is the main advantage of using hexadecimal numbers in computing?
If a computer uses 8 bits to represent integers, what is the range of signed integers it can represent using two's complement?
If a computer uses 8 bits to represent integers, what is the range of signed integers it can represent using two's complement?
Why is the two's complement method preferred for representing negative numbers in computers?
Why is the two's complement method preferred for representing negative numbers in computers?
What is the BCD representation for the decimal number 29?
What is the BCD representation for the decimal number 29?
In computing, what is a 'nybble'?
In computing, what is a 'nybble'?
What is the sum of the binary numbers 11011 and 10101, expressed as a decimal number?
What is the sum of the binary numbers 11011 and 10101, expressed as a decimal number?
According to the principles of fractional binary numbers, what value is represented by 0.01
?
According to the principles of fractional binary numbers, what value is represented by 0.01
?
Binary numbers are grouped into threes, which of the following number systems does this refer to?
Binary numbers are grouped into threes, which of the following number systems does this refer to?
Convert $55_{10}$ to octal.
Convert $55_{10}$ to octal.
Assuming you have the binary 1011
, pad the number on the left with zeroes to produce an octal number.
Assuming you have the binary 1011
, pad the number on the left with zeroes to produce an octal number.
Which one of the following was the first microprocessor?
Which one of the following was the first microprocessor?
According to the principles of octal digits, can the digit '9' be used?
According to the principles of octal digits, can the digit '9' be used?
Which of the following are valid hexadecimal characters?
Which of the following are valid hexadecimal characters?
Convert 256_{10}
to hexadecimal.
Convert 256_{10}
to hexadecimal.
What must you do to binary numbers before converting them into hexadecimal (base-16)?
What must you do to binary numbers before converting them into hexadecimal (base-16)?
What is the decimal equivalent of the hexadecimal number 3E8?
What is the decimal equivalent of the hexadecimal number 3E8?
Convert the hexadecimal number A2F
to octal.
Convert the hexadecimal number A2F
to octal.
To which base would dividing and aggregating the remainders be relevant to?
To which base would dividing and aggregating the remainders be relevant to?
Referring to the math of positive and negative binary numbers, which is a reason to implement the Two's Complement?
Referring to the math of positive and negative binary numbers, which is a reason to implement the Two's Complement?
To represent a number using BCD (Binary Coded Decimal), how should we handle the number 123?
To represent a number using BCD (Binary Coded Decimal), how should we handle the number 123?
Convert the BCD number 1001 0000 0011
to its decimal equivalent.
Convert the BCD number 1001 0000 0011
to its decimal equivalent.
Given that a human must interact with numbers read on a screen, which of the following representations is often better than straight binary?
Given that a human must interact with numbers read on a screen, which of the following representations is often better than straight binary?
Which is better for hardware to implement on a computer?
Which is better for hardware to implement on a computer?
Convert 234_(10)
to BCD.
Convert 234_(10)
to BCD.
Which of the following requires more bits to represent a Base-10 (decimal) value?
Which of the following requires more bits to represent a Base-10 (decimal) value?
A computer displays aircraft squawk codes
, and each is labeled as one of the digits 0, 1, 2, 3, 4, 5, 6, 7
. What representation are they using?
A computer displays aircraft squawk codes
, and each is labeled as one of the digits 0, 1, 2, 3, 4, 5, 6, 7
. What representation are they using?
Compared to Hex, how would you summarize binary?
Compared to Hex, how would you summarize binary?
What is a Bit Position used for?
What is a Bit Position used for?
Flashcards
Decimal Numbers (Base-10)
Decimal Numbers (Base-10)
Base-10 numbers, like 23,456, can be expressed as a sum of powers of 10 (e.g., 2 x 10,000 + 3 x 1,000...).
What is a Bit?
What is a Bit?
A digit in binary code; either zero or one.
What are Binary Numbers?
What are Binary Numbers?
Numbers using a base of two, with only digits 0 and 1.
Bit Positions.
Bit Positions.
Signup and view all the flashcards
What are Octal Numbers?
What are Octal Numbers?
Signup and view all the flashcards
Octal Grouping
Octal Grouping
Signup and view all the flashcards
Hexadecimal Numbers
Hexadecimal Numbers
Signup and view all the flashcards
Hex Grouping
Hex Grouping
Signup and view all the flashcards
Binary to Hexadecimal Conversion
Binary to Hexadecimal Conversion
Signup and view all the flashcards
Base Conversions
Base Conversions
Signup and view all the flashcards
Decimal to Other Bases
Decimal to Other Bases
Signup and view all the flashcards
Binary Point
Binary Point
Signup and view all the flashcards
Sign Bit
Sign Bit
Signup and view all the flashcards
Ones Complement
Ones Complement
Signup and view all the flashcards
Twos Complement
Twos Complement
Signup and view all the flashcards
Binary Addition
Binary Addition
Signup and view all the flashcards
Binary Overflow
Binary Overflow
Signup and view all the flashcards
Binary Multiplication
Binary Multiplication
Signup and view all the flashcards
Binary Division
Binary Division
Signup and view all the flashcards
Binary Coded Decimal (BCD)
Binary Coded Decimal (BCD)
Signup and view all the flashcards
Any Base to BCD
Any Base to BCD
Signup and view all the flashcards
BCD to Any Base
BCD to Any Base
Signup and view all the flashcards
Binary to Octal Conversion
Binary to Octal Conversion
Signup and view all the flashcards
Study Notes
- Unit 5 is about Binary Math
Decimal Numbers - Base 10
- Decimal numbers use base 10
- 23,456 can be written as: 2 X 10,000 + 3 X 1,000 + 4 X 100 + 5 X 10 + 6 X 1
- 23,456 can be also written as: 2 X 10^4 + 3 X 10^3 + 4 X 10^2 + 5 X 10^1 + 6 X 10^0
- Decimal fractions are written as: 6.789 = 6 × 10^0 + 7 X 10^-1 + 8 X 10^-2 + 9 X 10^-3
- A number can be specified as positive or negative by inserting a “+” or “-” at the start
Binary Numbers - Base 2
- Binary numbers use base 2
- The digits 0 and 1 are referred to as Binary Digits, or simply bits
- When count in a binary sequence, using only two digits, count as follows: 0, 01, 10, 11, 100, 101, 110, 111, 1000
- To remove ambiguity, binary numbers are written with a small “2” as a final subscript: 1011011101000002
- A binary calculator would only have two number keys “0” and "1"
- A binary calculator's display would only show a long number displaying O's and
Bit Positions and Decimal Values
- Bits are counted from right to left, starting with bit 0, then bit 1, 2, 3, and so on.
- The decimal value of each bit is 2^n, where 'n' is the bit's position
- For n = 0, 1, 2, 3, 4, 5, 6, 7, the value of 2^n is 1, 2, 4, 8, 16, 32, 64, 128
Unpacking Binary Numbers
- The method for unpacking binary numbers is identical to what is familiar with in decimal numbers
- The number 2 is raised to the binary position of each bit, when unpacking binary numbers
- Since multipliers are only 1 and 0, the “0” terms can be eliminated for simplicity
- 101101110100000 = 1X2^14 + 0X2^13 + 1X2^12 + 1X2^11 + 0X2^10 + 1X2^9 + 1X2^8 + 1X2^7 + 0X2^6 + 1X2^5 + 0X2^4 + 0X2^3 + 0X2^3 + 0X2^2 + 0X2^1 + 0X2^0
- 101101110100000 = 1X2^14 + 1X2^12 + 1X2^11 + 1X2^9 + 1X2^8 + 1X2^7 + 1X2^5
Converting a Binary Number to Decimal
- Recall that 2^1 = 2, 2^2 = 2X2=4, 2^3 = 2X2X2 = 8, 2^0 = 1
- 101101110100000 = 1X2^14 = 16,384 + 1X2^12 = 4,096 + 1X2^11 = 2,048 + 1X2^9 = 512 + 1X2^8 = 256 + 1X2^7 = 128 + 1X2^5 = 32 = 23,456 base 10
Octal Numbers - Base 8
- In the early days of computers, programs were loaded by hand, in a binary fashion by bit-switching each line, one bit at a time
- Setting switches to the correct state, either up or down representing 1 or 0, was how programs were loaded, and 'load' switch pressed
- Loading programs in this was was very tedious and error prone
Octal Number Representation
- Octal numbers are made up of digits from 0 to 7
- Each digit represents three bits of data
- Three bits of data are grouped into an octal digit
- A binary number, is Octal Equivalent:
- 000, is 0
- 001, is 1
- 010, is 2
- 011, is 3
- 100, is 4
- 101, is 5
- 110, is 6
- 111, is 7
Grouping the Bits - Octal Numbers
- Bits are grouped into threes, starting from right to left.
- The leftmost bits can be padded with O's to complete the three bit grouping
- 10112 rewritten is 001 011
- It can be converted to: 0012→18, 0112 → 38
- Thus, 10112 = 138 , which is more compact
Binary → Octal → Binary
- Begin with a given long binary number e.g. 1011011101000002
- Group it into threes: 101 101 110 100 000
- Convert each group of threes into the equivalent octal digit to form the number.
- 556408 is the equivalent octal
Is Octal "Dead”?
- Every commercial aircraft has a transponder that's interrogated by ATC to associate a radar return with a specific aircraft
- Each aircraft is assigned a specific "squawk code” by ATC which is a 4-digit octal number
- The 8 pushbuttons labelled 0 - 7 are octal
Hexadecimal Numbers - Base-16
- Some computers used groups of 4 bits to form a different numbering system
- In the 1960's, IBM in their lines of computers, including models 1800 and 360, used Hexadecimal numbers
- The first microprocessor (Intel® 4004) was a 4-bit machine, which led to 8-bit, then 16, 32 and now 64-bit machines--each nicely divisible by 4.
What's a Hex Number?
- The numbers are called hexadecimal, meaning 16
- The largest digit that can be displayed in a group of four is 11112 = 1510.
- Since there are 16 different digits, start using letters when the numbers run out, such that 10=A, 11=B, 12=C, 13=D, 14=E and 15=F
Hex Digits
- Note the digits are 0 to 9, then A to F.
- Hexadecimals are efficient, as 4 bits are rolled up to 1 digit
- The relationships between Binary Number, Hexadecimal, and Decimal (Base-10), are as follows:
- 0000, 0, 0
- 0001, 1, 1
- 0010, 2, 2
- 0011, 3, 3
- 0100, 4, 4
- 0101, 5, 5
- 0110, 6, 6
- 0111, 7, 7
- 1000, 8, 8
- 1001, 9, 9
- 1010, A, 10
- 1011, B, 11
- 1100, C, 12
- 1101, D, 13
- 1110, E, 14
- 1111, F, 15
Converting from Binary → Hex → Binary
- Start with a large binary number e.g. 1011011101000002
- It is divided into groups of 4, can pad the left grouping with an extra 0 on the left: resulting in: 0101 1011 1010 00002
- Each group is converted into its equivalent Hex digit: resulting in: 5BA016
Comparison of Bases
- Efficiency increases as one transitions from binary, octal and then hexadecimal
- Hexadecimal only requires one digit to express any decimal number from 0 to 15, while Binary requires four digits
- Hexadecimal is simply a way to express groups of 4 binary digits
- Octal is a way to express groups of 3 binary digits
- There is no simple correlation (on a binary digit basis) between Decimal and either of the other three bases
Base Conversions
- Numbers can be converted between bases: Hexadecimal, Decimal, Octal, and Binary
Converting from Binary to Other Bases
- Base 2 is converted easily into various other bases
Binary to Octal
- The binary number is groped into threes, starting from the right side
- Each group of three is converted to its octal equivalent
Binary to Hexadecimal
- Each group is converted into into its hexadecimal equivalent
Converting from Octal to Other Bases
- Base 8 is easily converted into other bases
Octal to Binary
- Each group of 3 bits is converted into the equivalent octal digit
Octal to Hexadecimal
- Three steps are required to convert from octal to hexadecimal
- Convert the octal number to binary
- Convert the binary to groups of four
- Convert the groups of four to hex.
Octal to Decimal
- The mantissa and exponent method is used to convert octal to decimal
- Note the base is 8
Converting from Hex to Other Bases
- Base 16 is easily converted into other bases
Hexadecimal to Binary
- The hexadecimal digits are converted into groups of four bits
- The groups are combined into a single binary number
Hexadecimal to Octal
- Three steps are required in converting from hexadecimal to octal
- Convert the hexadecimal number to binary
- Convert the binary to groups of three
- The groups of three are then converted to octal
Hexadecimal to Decimal
- This can be done using the exponent method
- Note the base is 16
- Recall that A=10, B=11, C=12, D=13, E=14 and F=15.
Conversion from Decimal to Other Bases
- Converting from decimal to other bases is quite different, as groupings and bits are less useful
- The general procedure for conversion from decimal to other bases:
- Conduct an integer division on the number by the base number (16 for hex, 8 for octal, 2 for binary)
- Set the remainder aside – this is what will be utilized to render the converted number
- Revert to step#1, this time using the quotient (result) from that step as the new dividend.
- Stop when the numerator is smaller than the denominator.
- Accumulate all the remainders from the most recent (MSB) to the first one (LSB) – this will be the newly converted value
Decimal to Binary
- An integer binary number is divided by 2 repeatedly, and the remainders make up the new binary number.
Decimal to Octal
- An integer decimal number is divided by a repeatedly, and the remainders make up the new octal number
Decimal to Hexadecimal
- An integer decimal number is divided by 16 repeatedly, and the remainders make up the new hexadecimal number
Binary Numbers
- Defined in Mathematical Domain as: Infinite, ranging from -∞ to +∞
- Defined in Physical Domain as: Defined by hardware (# of bits), for example, an 8-bit device is limited to a range of 00000000 to 111111112, which is 0 to 255 base 10
- Use of "." symbol is allowed as a Binary Point. This separates digits by powers of 2 (not 10 as in decimal)
- Use of "+" and "-" is allowed as Positive/Negative values doing math
- Sign bits are not typically used in binary circuits.
- Binary point and +/- signs are not defined in hardware---requiring different methods to achieve this functionality
Word, Byte, Nybble and Bit
- In computing memory is referred to as a "word", "byte", "nybble", and "bit"
- In the 1970's and 1980's processors were based on groupings of 8
- Today processors are based on sizes/groupings of 64
- The Intel 4004 µP was a 4-bit machine
- The 8008, 8080 and 8085 were 8 bit units
- The 8086 and 80286 were 16 bit machines
- The 80386, 80486 and early Pentium™™ were 32 bit machines
- Current Intel Core processors are 64 bits in length
Numbering of Bit Positions
- When assigning addresses to bits (i.e. their position), the process begins from the rightmost bit and moves to the left
- The rightmost bit is called zero, the second one is called one, etc.
- Bit positions aids in calculating the value of the bit in terms of its decimal equivalent Bit Zero: 2^0 has a value of 1 Bit 4: 2^4 = 16
Fractional Numbers
- A binary point separates numbers greater than 1 from numbers that are less than one
- Bits to the left of binary point have exponent weights that are either 0 or > 1
- Bits to the right of the binary point have exponent weights that are < 1
- As the number moves toward the left, the value of the bit increases, however when moving toward the right it decreases
Unbundling a Number with Binary Point
- A binary number 101.111 is expanded to:
- 1 0 1 . 1 1 1
- 1X2 0x2^1 1X2^0 1X2^-1 1X2^-2 1X2^-3
- The equivalent decimal number is 4 + 0 + 1 + 0.5 + 0.25+ 0.125 = 5.875
Negative Numbers (Using a Sign Bit)
- A method of numbering that is not standard, instead requires definition
- It requires the definition a finite number of bits to the number.
- The leftmost bit is defined as the sign bit
- A “1” in this place denotes a negative number
- A “0” denotes a positive number
- However, this is not how negative numbers are normally treated.
Negative Numbers - Ones Complement
- One method of showing a negative number is known as the one's complement
- One's complements involves taking the binary number and complementing each bit, that is, change the zeros to ones and the ones to zeros
- The Ones Complement of 00101001 is 11010110
Negative Numbers - Twos Complement
- Twos Complement is a more standard approach
- To determine Twos Complement:
-
- Find the Ones Complement of the number
-
- Add “1” to the Ones Complement to get the Twos Complement
-
Potential Confusion
- How to identify if an 8-bit binary number is positive or negative?
- It is in fact difficult to properly show an 8-bit number with a meaningful "sign”, and requires the use 9 bits
Binary Arithmetic - Addition
- Binary arithmetic, binary addition tables, are much simpler
- Binary addition of two or three bits can be summarized in a few rules:
- 0 + 0 = 0
- 0 + 1 = 1
- 1 + 0 = 1
- 1 + 1 = 10
- 1 + 1 + 1 = 11
- There are rules for adding two or three bits
Adding Numbers that Require a "Carry”
- Similar to decimal addition is the instance when the result of the addition produced the values of “10” or “11” In decimal addition, it need to “carry” a "1" when
Refresher - Twos Complement
- To express an 8-bit negative number using the Twos Complement method, then carry though with the following steps:
- One's Complement: flip the bits
- Add 1:
- Two's Complement: the negative number displayed as an 8-bit number
Proving That the Twos Complement is Valid
- To affirm that Twos Complement is truly valid the following statement should hold true: If we add 41 +(-41) the outcome/result is expected to be zero, which does hold true, meaning the mathematical conclusion valid
Example 1 - Subtracting Two Numbers
- Using binary methods lets calculate 9 – 4 = 5
- Following set the word length at 8 bits to make reading easier
- Two's complement is calculated to retrieve the binary equivalent of -4 through binary processes
Example 1 (Continued)
- Following adding calculate 9 to (-4) to discover the answer of the calculation:
- Discard the leftmost bit--as it is beyond the limits of the 8-bit word
- The correct result reads, 1012 = 510. This is indeed correct
- Example 1 is successfully calculated
Example 2 - Subtracting Two Numbers
- Calculation of 4 - 9 = -5 is to be handled by binary code
- Set the word length also at 8 bits to ease the process
- Again, two's complement is calculated to retrieve the binary equivalent -9 through binary processes
Example 2 (Continued)
- Addition of 4 to (-9) reveals the calculated answer: But, 11111011 doesn't look like -510.
- To convert the number back to more recognizable form: transform number back to by performing two's complement which negates it
- Following two's complement the result is 1012 = 510, which confirms the former conclusion
- The correct answer is 11111011. It is not 00000101
Multiplication of Two Binary Numbers
- A few concepts are needed to know, since multiplication can be thought of as an AND function:
- Multiplication 0 X 0 is equal to 0
- Multiplication of 0 X 1 is equal to 0
- Multiplication of 1 X 0 is equal to 0
- Multiplication of 1 X 1 is equal to 1
Example - Multiplication
- Let's calculate 910 X 1310 = 11710.
Division of Two Numbers
- Binary division obeys the same general rules that is abided for the long-form division performed in grade school
- The calculation of: 12 ÷ 2 = 6, is used to illustrate the method
Binary Coded Decimal (BCD)
- BCD utilized anywhere that human input or output is mandated, as it is customary to function in decimal numbers.
- Input devices ex: keyboards, thumbwheel switches, are arranged with decimal number inputs
- Output devices ex: LED or LCD displays which exhibits numbers in a well known set of numbers
- It's often the numbers are illuminating various forms
Digital Displays Utilizing BCD Numbers
- The shown example displays digital LED devices
- Each digit display holds a decoder that turns a binary input into signals that drive the LED displays For instance, to produce the digit "3", a binary value of 0011 is sent to the leftmost display, and for the value "9", a binary value of 1001 is sent to display.
- With this operation one can see that 367910 ≠ 0011011001111001, which is the BCD representation that requires the use of 16 bits
- In the case of when 367910 is equal to 1110010111112 it merely requires of use requires 12 bits
BCD Conversion
- Each decimal digit will need 4 bits
- Conversion is summarized within the following table:
- Binary Value B3 MSB B2 B1 B0 LSB - for 0, 0, 0, 0, 0
- Binary Value B3 MSB B2 B1 B0 LSB - for 1, 0, 0, 0, 1
- Binary Value B3 MSB B2 B1 B0 LSB - for 2, 0, 0, 1, 0
- Binary Value B3 MSB B2 B1 B0 LSB - for 3, 0, 0, 1, 1
- Binary Value B3 MSB B2 B1 B0 LSB - for 4, 0, 1, 0, 0
- Binary Value B3 MSB B2 B1 B0 LSB - for 5, 0, 1, 0, 1
- Binary Value B3 MSB B2 B1 B0 LSB - for 6, 0, 1, 1, 0
- Binary Value B3 MSB B2 B1 B0 LSB - for 7, 0, 1, 1, 1
- Binary Value B3 MSB B2 B1 B0 LSB - for 8, 1, 0, 0, 0
- Binary Value B3 MSB B2 B1 B0 LSB - for 9, 1, 0, 0, 1 The source binary number must first needs to be convert to decimal, and then there after each decimal digit has to be turned into binary
Converting any Base Number to BCD
- The most direct/straight forward method for converting a number into base BCD is: First convert it to decimal Converting each and every digit into BCD through the assistance of reference/Lookup Tables
Example: Hexadecimal to BCD
- The following calculation is to convert 27F216 into BCD Without the need to go into details: we uncover that it can be translated into BCD for display.
Converting a BCD Number to Another Base
Converting what was previously BCD code into another base requires the following actions:
- Firstly conversion of the numerical to its corresponding decimal code
- Secondly to the designated Base Code
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.