Programming logic controllers
Download
1 / 11

Programming Logic Controllers - PowerPoint PPT Presentation


  • 80 Views
  • Uploaded on

Programming Logic Controllers. Number Systems and Codes - Chapter 3. Decimal. Each “place” in the decimal system represents a power of ten Hundred’s Ten’s One’s Tenths Hundredth’s . Binary. Each “place” in the binary system represents a power of two Four’s Two’s One’s Half’s

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Programming Logic Controllers' - gene


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Programming logic controllers

Programming Logic Controllers

Number Systems and Codes - Chapter 3


Decimal
Decimal

  • Each “place” in the decimal system represents a power of ten

  • Hundred’s

  • Ten’s

  • One’s

  • Tenths

  • Hundredth’s


Binary
Binary

  • Each “place” in the binary system represents a power of two

  • Four’s

  • Two’s

  • One’s

  • Half’s

  • Quarter’s


Hexadecimal
Hexadecimal

  • Each “place” in the hexadecimal system represents a power of sixteen

  • 0 – 9 = 0 – 9

  • A = 10

  • B = 11

  • C = 12

  • D = 13

  • E = 14

  • F = 15


Hexadecimal and binary
Hexadecimal and Binary

  • Hex numbers can be preceded with 0x

  • Hex is a shorthand way of writing binary.

  • Each Hex digit is 4 binary digits

  • So hex 0x12 is binary 00010010

  • So hex 0xAF is binary 10101111


Octal
Octal

  • Each “place” in the octal system represents a power of eight

  • Each octal digit is 3 binary digits

  • Uses digits 0-7

  • Some systems indicateoctal numbers using a leading 0

    • Eg 023 = 010011

    • Eg 075 = 111101


Programming notes
Programming Notes

Many programming environments allow you to specify literal constants in other than decimal formats. The following is one somewhat common syntax.

0x prefix indicates hexadecimal

0b prefixed indicate binary

0 prefix indicates octal


Binary coded decimal bcd
Binary Coded Decimal - BCD

  • 4 bits represent a single decimal digit

  • Only 0 – 9 are valid

  • BCD 0111001100010010 = decimal 7312


Gray code
Gray Code

  • Special encoding system where two successive numbers are one “bit flip” apart

  • 00 = 0

  • 01 = 1

  • 11 = 2

  • 10 = 3

  • Special uses like optical encoders


Binary arithmetic
Binary Arithmetic

Addition

Subtraction

Multiplication

Division


Binary fractions
Binary Fractions

  • Hole around zero

  • Decimal .1 has no binary equivalent

  • 1/3 has no decimal equivalent (or binary)

  • 1/2 + 1/4 + 1/8 + 1/16 + 1/32 + …


ad