Binary Numbers

Binary Numbers
Slide Note
Embed
Share

Dive into the world of binary numbers, exploring how they can be used efficiently for counting and mastering the art of conversion between binary and decimal numbers. Discover the logic behind binary digits and how they power modern technology and computing systems. Unveil the simplicity and elegance of binary arithmetic and enhance your understanding of this fundamental concept that underpins digital computation.

  • Binary Numbers
  • Counting
  • Conversions
  • Decimal
  • Logic Circuits

Uploaded on Feb 20, 2025 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Binary Numbers AIM: To understand binary numbers, how binary can be used for counting and how to convert between binary numbers and decimal numbers. PRIOR KNOWLEDGE: Logic circuits www.pfnicholls.com

  2. Introduction Binary is a number system that only uses two different numbers, these are 0 and 1. In an electronic circuit the number 0 and the number 1 can easily be represented by a voltage being OFF or ON Binary is ideal for use with digital circuits which are either ON or OFF In a digital circuit, ON represents Binary 1 and OFF represents Binary 0. The binary characters 0 and 1 are called bits. A number of bits make a binary word. For example, the binary number 0 1 1 0 is a 4 bit binary word. An 8 bit binary word is a special case and is called a byte.

  3. 1 Bit Binary The first two numbers, Zero and One, in our usual number system (decimal) are shown below. Decimal Zero is represented by binary 0, Decimal One is represented by binary 1. Decimal Value Binary BIT (worth 1) Explanation 0 0 Zero lots of 1 1 1 One lot of 1

  4. 2 Bit Binary To represent the decimal numbers Two and Three, more digits are needed. To do this there is a second column in binary. The first (right hand) column represents a quantity of 1 (unity) The second (left hand) column represents a quantity of 2 (21) Decimal Binary BIT (worth 2) Binary BIT (worth 1) Explanation 0 0 0 zero lots of two and zero lots of 1 (0 2 + 0 1) 1 0 1 zero lots of two and one lot of 1 (0 2 + 1 1) 2 1 0 one 2 and zero lots of 1 (1 2 + 0 1 = 2) 3 1 1 one 2 and one 1 (1 2 + 1 1 = 2 + 1 = 3)

  5. 3 Bit Binary To represent the next decimal numbers (Four to Seven) another column is required on the left hand side. This column represents the quantity 4 (22). Therefore the first, right hand, column represents the number of 1s, the second column represents 2s and the third, left hand, column represents the number of 4s: Decimal Binary 4s Binary 2s Binary 1s Explanation 4 1 0 0 one 4, zero 2s and zero 1s 5 1 0 1 one 4, zero 2s and one 1 (1 4 + 0 2 + 1 1 = 4 + 1 = 5) 6 1 1 0 1 4 + 1 2 + 0 1 = 4 + 2 = 6 7 1 1 1 1 4 + 1 2 + 1 1 = 4 + 2 + 1 = 7 Three columns can represent eight decimal numbers (0 7) because there are eight different combinations of 1s and 0s in three columns. Notice 23 = 8.

  6. 4 Bit Binary 0 0 0 0 0 It would be better if all the binary numbers had the same number of digits (bits) In the decimal number 0 to 7, the MSB is zero so adds no value to the binary number 1 0 0 0 1 2 0 0 1 0 Four bits are needed to count to decimal 9. 3 0 0 1 1 4 0 1 0 0 The right hand bit is called the Least Significant bit (LSB) and is worth 1. Now all the binary numbers have 4 bits 5 0 1 0 1 6 0 1 1 0 7 0 1 1 1 The left hand bit is called the Most Significant bit (MSB) and is worth 8. 8 1 0 0 0 ... one 8 only 9 1 0 0 1

  7. More 4 Bit Binary Not all of the combinations have been used yet 10 1 0 1 0 11 1 0 1 1 24 = 16 12 1 1 0 0 (one 8 and one 4) with four bits, 16 numbers can be represented which are decimal 0 to 15 13 1 1 0 1 14 1 1 1 0 15 1 1 1 1 The biggest number represented is 15 because to represent the decimal number 16 requires a 5th bit (1 8 + 1 4 + 1 2 + 1 1 = 15) 25 = 16, the 5th bit is worth 16

  8. More Bits 1st bit 20 = 1 Bigger numbers are represented by more bits 2nd bit 21 = 2 Each bit is worth twice the previous bit 3rd bit 22 = 4 4th bit 23 = 8 For example, an 8 bit binary number can represent 256 different decimal values which are the numbers 0 to 255 5th bit 24 = 16 6th bit 25 = 32 7th bit 26 = 64 In binary the maximum 8 bit binary word is 1 1 1 1 1 1 1 1 8th bit 27 = 128 9th bit 28 = 256 Which is equivalent to: 10th bit 29 = 512 1 128 + 1 64 + 1 32 + 1 16 + 1 8 + 1 4 + 1 2 + 1 1 = 255 11th bit 210 = 1024

  9. Converting Decimal to Binary Decide how many bits are necessary and then decide which bits are necessary to add up to the desired decimal number. Example: What is decimal 27 in binary? Solution: The 6th bit is worth 32 and that is more than needed therefore use 5 bits. 5th bit 16. Is it needed? Yes. 27 16 = 11 remaining 4th bit 8. Is it needed for the remaining 11? Yes. 11 8 = 3 remaining 3rd bit 4. Is it needed? No, only 3 remaining, don't need a 4 2nd bit 2. Is it needed for 3? Yes. 3 2 = 1 remaining 1st bit 1. Is it needed? Yes Therefore 27 1 1 0 1 1 because 1 16 + 1 8 + 0 4 + 1 2 + 1 1 = 27

  10. Converting Decimal to Binary Example: What is 42 in binary? Solution: 6 bits are required. 7th bit 64 which is too big. 1 32 ... 42 32 = 10 Note, sometimes it is necessary to represent numbers as 8 bit binary numbers 0 16 1 8 ... 10 8 = 2 0 4 In this case just add extra zeros to the left hand side as these do not add any value: 1 2 ... 2 2 = 0 0 1 27 0 0 0 1 1 0 1 1 Therefore 42 1 0 1 0 1 0 42 0 0 1 0 1 0 1 0

  11. Converting Binary to Decimal To convert a binary number to decimal, add up each digit that is none zero. Example: What is 0 1 1 1 0 0 0 1 in decimal? Solution: The MSB is worth 128 as this is an 8 bit binary number (27 = 128) From the left we have: 0 128 + 1 64 + 1 32 + 1 16 + 0 8 + 0 4 + 0 2 + 1 1 = 113 0 1 1 1 0 0 0 1 113

  12. Summary Binary numbers are a sequence of Bits. Each Bit is represented as a zero (0) or a one (1) A sequence of Bits is called a Word, 8 Bits make a Byte The right hand Bit is called the Least Significant Bit (LSB) and has a value of unity (1) Other Bits are worth 2, 4, 8, 16 etc the powers of 2. For example the 5th Bit is worth 24 = 16 Three Bits represent the decimal numbers 0 to 7 (000 to 111) Four Bits represent decimal numbers 0 to 15 Eight Bits represent decimal numbers 0 to 255

  13. Questions 1. What is the binary number 1 0 0 1 in decimal? 2. What is the binary number 0 0 0 1 1 0 0 1 in decimal? 3. In question 2, what is the value of the MSB? 4. What is the decimal number 36 in binary? 5. What is the decimal number 17 as an 8 Bit binary word? 6. What is the decimal number 10 in binary? 7. Why might question 6 cause confusion? 8. What is the biggest decimal number that can be represented by a 10 Bit binary word?

  14. Answers 1. 5 2. 25 3. 8 Bits, 27 = 128 4. 1 0 0 1 0 0 5. 0 0 0 1 0 0 0 1 6. 1 0 1 0 7. Because both decimal 10 and binary 1 0 1 0 look like binary numbers 8. 11th Bit is worth 1024 (210) and therefore a 10 Bit binary word can represent up to decimal 1023

More Related Content