Binary - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Binary

Description:

Binary – PowerPoint PPT presentation

Number of Views:42
Avg rating:3.0/5.0
Slides: 18
Provided by: patel7
Category:
Tags: binary | kilobytes

less

Transcript and Presenter's Notes

Title: Binary


1
Binary
Written By Pat Ellison-Soper
2
The Decimal System
  • The Decimal Number System uses base 10.
  • It includes the digits from 0 through 9.
  • All numbers can be represented by any number
    times 10 to some power
  • The weighted value for each position is as
    follows
  • In the decimal system the number 123 is
    represented

3
Decimal Floating Points
  • In the decimal system digits appearing to the
    right of the floating point represent a value
    between zero and nine, times an increasing
    negative power of ten.
  • For example, the value 725.194 is represented as
    follows
  • 700 20 5
    0.1 0.09
    0.004 725.194
  • 700.00
  • 20.00
  • 5.00
  • 0.10
  • 0.09
  • 0.004
  • 725.194

4
Why the Binary System?
  • Computer systems do not represent numeric values
    using the decimal system. Instead, they typically
    use a binary or two's complement numbering
    system.
  • We have learned that a computer circuit is made
    out of transistors. Transistors have two states,
    on and off.
  • With two states there is less chance for error

5
The Binary System
  • Modern computer systems operate using binary
    logic.
  • We learned previously that the computer
    represents values using two voltage levels (0V
    for logic 0 and either 3.3 V or 5V for logic
    1).
  • The binary number system works like the decimal
    number system except the Binary Number System
    uses base 2 and includes only the digits 0 and 1
  • The weighted values for each position is
    determined by place as follows

6
The Chart Method Binary to Decimal
  • The binary system uses powers of two. The
    rightmost digit in binary represents 2 0, or
    one. Any number raised to the zero power equals
    one.
  • The next digit to the left represents 2 1 or 2.
    The next digit to the left represents 2 2, or
    4, and so on.
  • Each successive digit doubles the number of
    possible values.
  • How numbers are stored in binary notation 1 is
    ON, and 0 is OFF. We only add the decimal values
    of the ON switches to determine the decimal
    number.
  • Add 16 0 4 2 0 to equal the decimal
    number 22.
  • Add 32 16 0 4 0 1 to equal the decimal
    number 53. 

7
The Chart Method Decimal to Binary
  • Start at the left and turn on any switch that is
    less than the value of the decimal number.
    Subtract that value from the decimal number.
  • Continue to the right, turning on the switch for
    any value that does not exceed the difference.
  • Example Find the binary value of the base 10
    number 29.
  • We can not turn on the switch that equals 32
    because it is greater than the decimal number 29.
  • The first switch we can turn on is equal to 16.
    We subtract 16 from 29. Our new value is 13.
  • The first switch we can turn on is equal to 8.
    We subtract 8 from 13. Our new value is 5.
  • Continue to turn on switches and subtract that
    value until you have the value of the decimal
    number.

8
Decimal to Binary The Subtraction Method
  • Start with a weighted place value greater than
    the number. If the number is greater than the
    weighted value, write down a 1 in the Binary
    column and subtract the weighted value.
  • If the number is less than the weighted value,
    write down a 0 in the Binary column and subtract
    0.
  • Continue until the result is 0.
  • Convert 2,671 in Base 10 to a Binary Number
  • Weighted Value Subtraction Result Binary
  • 212 4096 2671 - 0 2671 0
  • 211 2048 2671 - 2048 623 0 1
  • 210 1024 623 - 0 623 0 10
  • 29 512 623 - 512 111 0 101
  • 28 256 111 - 0 111 0 1010
  • 27 128 111 - 0 111 0 1010 0
  • 26 64 111 - 64 47 0 1010 01
  • 25 32 47 - 32 15 0 1010 011
  • 24 16 15 - 0 15 0 1010 0110
  • 23 8 15 8 7 0 1010 0110 1
  • 22 4 7 - 4 3 0 1010 0110 11
  • 21 2 3 - 2 1 0 1010 0110 111
  • 20 1 1 - 1 0 0 1010 0110 1111

9
Decimal to Binary Successive Division
  • Successive division to change a decimal system
    number to a binary system number.
  • Divide by the base number, in this case 2.
  • Divide until the quotient equals 0.
  • Read the binary number by reading the remainder
    numbers from bottom to top.
  • Let's find the binary representation of the
    decimal number 345.
  •  Division Quotient  Remainder 
  • 345 / 2  172 1
  • 172 / 2  86 0
  • 86 / 2 43  0
  • 43 / 2 21 1
  • 21 / 2 10  1
  • 10 / 2 5  0 
  • 5 /2  2  1
  • 2 /2  1  0
  • 1 / 2 0  1
  •  The binary representation of 345 is 0001 0101
    1001

10
Binary to Decimal Multiply by Place Value
  • Binary to Decimal uses Multiplication
  • Example Find the base 10 value of 1 0101 1001
  • Now add 256 64 16 8 1 345

11
Bit Number Formats
  • Binary numbers are written as a sequence of bits.
  • We have defined boundaries for these bits.
    Computer scientists add leading zeroes to adjust
    the binary number to a desired size boundary.
    These boundaries are
  • Name Size in bits Example
  • Bit 1 1
  • Nibble 4 0101
  • Byte 8 0000 0101
  • Word 16 0000 0000 0000 0101
  • The rightmost bit in a binary number is bit
    position zero. Bit zero is usually referred to as
    the LSB, least significant bit. Each bit to the
    left is given the next successive bit number.
  • The left-most bit is typically called the MSB,
    most significant bit. Intermediate bits are
    referred to by their respective bit numbers.

12
Binary Data Organization
  • The Bit
  • The smallest "unit" of data on a binary computer
    is a single bit. A single bit is capable of
    representing only two different values, zero or
    one.
  • The Nibble
  • A nibble is a collection of bits on a 4-bit
    boundary. When we study hexadecimal numbers you
    will learn that it takes four bits to represent a
    hexadecimal digit.
  • The Byte
  • The most important data structure used by
    microprocessors is the byte. A byte consists of
    eight bits and is the smallest addressable data
    item in the microprocessor. This means that the
    smallest item that can be individually accessed
    by a program is an 8-bit value.
  • Since a byte contains eight bits, it can
    represent 2 8, or 256, different values.
    Computers use a byte to represent
  • unsigned numeric values in the range 0 gt 255
  • signed numbers in the range -128 gt 127
  • ASCII character codes

13
More about Binary Representation
  • To represent integers, which can be positive or
    negative, computers typically use a sign notation
    on the binary.
  • 0 is positive and 1 is negative and this number
    precedes the the rest of the number.
  • Example If 10111 is 23, then 1 10111 would be
    - 23.
  • Every three decimal digits is separated with a
    comma to make larger numbers easier to read.
    Example 1, 446, 9782
  • The convention for binary numbers is to add a
    space every four digits starting from the least
    significant digit on the left of the decimal
    point.
  • Example The binary value 1010111110110010 would
    be written 1010 1111 1011 0010.

14
Supplement Binary Measuring Units
  • Units of measure with verbal prefixes for large
    quantities
  • kilobytes(K) 2 10 1,024
  • megabytes(M) 2 20 1,048,576
  • gigabytes(G) 2 30 1,073,741,824
  • terabytes(T) 2 40 1,099,511,627,776
  • petabytes( P) 2 50 1,125,899,906,842,624
  • exabytes(E) 2 60 1,152,921,504,606,846,976
  • zettabytes(Z) 2 70 1,000,000,000,000,000,000,000
  • yottabytes(Y) 2 80 1,000,000,000,000,000,000,00
    0,000

15
Supplement Logic Explanation of 0 Power
  • Why is any number raised to the zero power equal
    to one?
  • Example Let's look at the list of numbers, the
    integer powers of 3 and their decimal values.
  • A pattern forms here.
  • Move to the left in the list, multiply by 3
  • Move to the right in the list, divide by 3.
  • Keep the sequence going to the right and dividing
    by 3 and the sequence looks like this

16
Supplement Law of Exponents for 0 Power
  • For all n, x, and y.
  • n x
  • n (x - y)
  • n y
  • 3 4
  • 1 3 (4 - 4) 3 0
    Therefore 3 0 1

17
Supplement Exponent Rules
  • Rules of One
  • Any number raised to the power of 1 equals
    itself.
  • One raised to any power is one.
  • Product Rule
  • When multiplying two powers that have the same
    base, you can add the exponents.
  • Power Rule
  • To raise a power to a power, just multiply the
    exponents.
  • Quotient Rule
  • Divide two powers with the same base by
    subtracting the exponents.
  • Zero Rule
  • Any nonzero number raised to the power of zero
    equals 1.
  • Negative Exponents
  • Any nonzero number raised to a negative power
    equals its reciprocal raised to the opposite
    positive power.
Write a Comment
User Comments (0)
About PowerShow.com