Binary Numbers

Binary Numbers
Slide Note
Embed
Share

The content delves into the basics of binary numbers, discussing the binary digit as the fundamental unit of computer information. It covers finite-precision numbers and the radix system, including conversion between decimal and binary. Addition concepts, system conversions, and group practice exercises are also explored.

  • Binary Numbers
  • Systems
  • Finite-Precision
  • Radix System
  • Conversion

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 Appendix A

  2. Binary Bit (binary digit) Most basic unit of information on a computer Has one of two values: 0 or 1 Interpretation depends on context Literal 0 / 1 True / False Part of more complex piece of information (number, string, etc.) Byte (almost always 8 bits) Smallest addressable unit of memory Can store Single extended ASCII character Unsigned values [0, 255] Signed values [-128, 127] Multi-byte values int is typically 4 bytes (32 bits) 2

  3. Finite-Precision Numbers Consider representing numbers by three decimal digits [0, 999] There are some problems: Numbers larger than 999 Negative numbers Fractions Irrational numbers Complex numbers Important property on the set of integers is closure with respect to operations (e.g., add, subtract, multiply) Finite precision numbers are not closed with respect to these operations Ex: result is too large (overflow error) or too small (underflow error) 3

  4. Radix System: Decimal and Binary Decimal: 3 4 0 2 Binary: 1 0 1 1 4

  5. Addition: note the overflow Decimal 9 + 1 1 0 Decimal 1 1 + 1 1 2 Binary 1 1 + 1 1 0 0 5

  6. Conversion between systems Example 1: Binary: 1 0 1 1 1 1 0 1 1 0 Decimal Binary 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 10000 Hex 0 1 0 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111 Hexadecimal: Decimal: Example 2: Hexadecimal: D B Binary: 10 Decimal: 6

  7. Group practice 1. 2. Convert 10 0110 1001 (binary) to decimal and hexadecimal Which of the following are valid hexadecimal numbers? a) BED b) CAB c) DAB d) DECADE e) ACCEDED f) BAG g) DAD How many different positive integers can be expressed in k digits using radix r numbers (note: radix 2 = binary; radix 10 = decimal; radix 16 = hexadecimal) 3. 7

More Related Content