2011, The McGraw-Hill Companies, Inc. Chapter 3



Similar documents
Oct: 50 8 = 6 (r = 2) 6 8 = 0 (r = 6) Writing the remainders in reverse order we get: (50) 10 = (62) 8

LSN 2 Number Systems. ECT 224 Digital Computer Fundamentals. Department of Engineering Technology

EE 261 Introduction to Logic Circuits. Module #2 Number Systems

The string of digits in the binary number system represents the quantity

Systems I: Computer Organization and Architecture

Binary Representation. Number Systems. Base 10, Base 2, Base 16. Positional Notation. Conversion of Any Base to Decimal.

Digital codes. Resources and methods for learning about these subjects (list a few here, in preparation for your research):

Digital System Design Prof. D Roychoudhry Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Binary Numbers. Binary Octal Hexadecimal

plc numbers Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

Chapter 1: Digital Systems and Binary Numbers

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 TUTORIAL OUTCOME 2 Part 1

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Useful Number Systems

CPEN Digital Logic Design Binary Systems

Chapter 4: Computer Codes

NUMBER SYSTEMS. 1.1 Introduction

Lecture 11: Number Systems

Numeral Systems. The number twenty-five can be represented in many ways: Decimal system (base 10): 25 Roman numerals:

Levent EREN A-306 Office Phone: INTRODUCTION TO DIGITAL LOGIC

Number and codes in digital systems

Digital Design. Assoc. Prof. Dr. Berna Örs Yalçın

Goals. Unary Numbers. Decimal Numbers. 3,148 is s 100 s 10 s 1 s. Number Bases 1/12/2009. COMP370 Intro to Computer Architecture 1

Number Conversions Dr. Sarita Agarwal (Acharya Narendra Dev College,University of Delhi)

Number Systems. Introduction / Number Systems

Numbering Systems. InThisAppendix...

MEP Y9 Practice Book A

Lecture 2. Binary and Hexadecimal Numbers

Computer Science 281 Binary and Hexadecimal Review

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.

Number Representation

Binary, Hexadecimal, Octal, and BCD Numbers

Binary Representation

Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer

COMBINATIONAL CIRCUITS

The Answer to the 14 Most Frequently Asked Modbus Questions

Encoding Text with a Small Alphabet

Base Conversion written by Cathy Saxton

CSI 333 Lecture 1 Number Systems

BINARY CODED DECIMAL: B.C.D.

Chapter 2. Binary Values and Number Systems

CS101 Lecture 11: Number Systems and Binary Numbers. Aaron Stevens 14 February 2011

3. Convert a number from one number system to another

Technical Support Bulletin Nr.18 Modbus Tips

Today. Binary addition Representing negative numbers. Andrew H. Fagg: Embedded Real- Time Systems: Binary Arithmetic

Counting in base 10, 2 and 16

Decimal to Binary Conversion

Section 1.4 Place Value Systems of Numeration in Other Bases

Solution for Homework 2

Binary Numbering Systems

COMPSCI 210. Binary Fractions. Agenda & Reading

Chapter Binary, Octal, Decimal, and Hexadecimal Calculations

ARINC 429 Protocol Tutorial

Cyber Security Workshop Encryption Reference Manual

Verilog - Representation of Number Literals

ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6)

ProCod. User Manual. Programming software for TWK - Encoders Series CRF and DAF CRF DE 08 / 10

Everything you wanted to know about using Hexadecimal and Octal Numbers in Visual Basic 6

Memory is implemented as an array of electronic switches

2011, The McGraw-Hill Companies, Inc. Chapter 5

Technical Information. Digital Signals. 1 bit. Part 1 Fundamentals

TIMING, COUNTING, AND DATA-HANDLING INSTRUCTIONS. Key Points

This 3-digit ASCII string could also be calculated as n = (Data[2]-0x30) +10*((Data[1]-0x30)+10*(Data[0]-0x30));

The Hexadecimal Number System and Memory Addressing

1.Eastron SDM220Modbus Smart Meter Modbus Protocol Implementation V1.0

Multiple Choice Questions(Computer)

The use of binary codes to represent characters

Streaming Lossless Data Compression Algorithm (SLDC)

HOMEWORKS. RS-232 Protocol. Data Protocol for Communicating with Lutron's HOMEWORKS System

MBP_MSTR: Modbus Plus Master 12

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System?

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware

Parallel Port Interfacing with Switches, Keypad and Rotatory encoder

Lecture N -1- PHYS Microcontrollers

Single channel data transceiver module WIZ2-434

2 Number Systems. Source: Foundations of Computer Science Cengage Learning. Objectives After studying this chapter, the student should be able to:

Digital Electronics Detailed Outline

The New IoT Standard: Any App for Any Device Using Any Data Format. Mike Weiner Product Manager, Omega DevCloud KORE Telematics

ARINC429. Specification Tutorial

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

DVPPF02-H2. PROFIBUS DP Slave Communication Module Application Manual

Count the Dots Binary Numbers

The goal is to program the PLC and HMI to count with the following behaviors:

Modbus RTU Communications RX/WX and MRX/MWX

Sistemas Digitais I LESI - 2º ano

Digital Logic Design. Introduction

CCNA R&S: Introduction to Networks. Chapter 5: Ethernet

Part Number Description Packages available

Z80 Instruction Set. Z80 Assembly Language

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

HOMEWORK # 2 SOLUTIO

Programming Logic controllers

A Step towards an Easy Interconversion of Various Number Systems

International Securities Identification Number (ISIN)

=

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)

Process Control and Automation using Modbus Protocol

PLC Master / Slave Example

Analog Input Module Cat. No IFE User Manual

DRS-6/1 Doppler Radar Sensor

Transcription:

Chapter 3

3.1 Decimal System

The radix or base of a number system determines the total number of different symbols or digits used by that system. The decimal system has a base of 10 with the digits 0 through 9 being used. The value of a decimal number depends on the digits that make up the number and the place value of each digit.

3.2 Binary System

The binary system has a base of 2 and the only allowable digits are 0 and 1. With digital circuits it is easy to distinguish between two voltage levels, which can be related to the binary digits 1 and 0.

Since the binary system uses only two digits, each position of a binary number can go through only two changes, and then a 1 is carried to the immediate left position. All numbering systems start at zero.

NUMBER SYSTEMS Decimal (base 10) Binary (base 2) Octal (base 8) Hexadecimal (base 16)

Converting a binary number to a decimal number.

Each digit of a binary number is known as a bit. Each word is capable of storing data in the form of bits. A group of 8 bits is a byte. The least significant bit (LSB) represents the smallest value and the most significant bit (MSB) represents the largest value.

PLC memory is organized using bytes, single words, or double words. If the memory size is 1 K word, it can store 1024 words or 16,384 (1024 x 16) bits of information using 16-bit words,

Converting a decimal number to a binary number.

Computer memory is a series of binary 1s and 0s. Output status file made up of single bits grouped into 16-bit words. One 16-bit output file word is reserved for each slot in the chassis. Each bit represents the ON or OFF state of one output point.

3.3 Negative Numbers

Binary systems can not use positive and negative symbols to represent the polarity of a number. Signed Binary Numbers In signed binary numbers, the left-most bit is the equivalent of a +/- sign. "0" indicates that the number is positive, "1" indicates negative.

Another method of expressing a negative number is by using the complement of a binary number. To complement a binary number, change all the 1s to 0s and all the 0s to 1s. This is known as the 1 s complement form of a binary number.

2 s complement is the binary number that results when 1 is added to the 1 s complement. 0 sign bit indicates a positive number. 1 sign bit indicates a negative number.

3.4 Octal System

The octal numbering system is a base 8 system Numbers 8 and 9 not allowed

The octal numbering system is used because 8 data bits make up a byte of information that can be addressed. PLC-5 controllers use octal-based I/O addressing.

Octal is a convenient means of handling large binary numbers. One octal digit can be used to express three binary digits. Converting an octal number to a decimal number.

Octal converts easily to binary equivalents. The octal number 462 is converted to its binary equivalent by assembling the 3-bit groups.

3.5 Hexadecimal System

The hexadecimal (hex) system is a base 16 system. Letters A to F are used to represent decimal numbers 10 to 15.

The hex numbering system is used in PLCs because a word of data consists of 16 data bits. Converting hexadecimal to decimal. Hexadecimal digits in the columns are multiplied by the base 16 weight, depending on digit significance.

Converting decimal to hexadecimal. Conversion is accomplished by writing the 4-bit binary equivalent of the hex digit for each position.

3.6 Binary Coded Decimal System

The binary coded decimal (BCD) system uses 4 bits to represent each decimal digit. The 4 bits used are the binary equivalents of the numbers from 0 to 9.

The BCD representation of a decimal number is obtained by replacing each decimal digit by its BCD equivalent.

To distinguish the BCD numbering system from a binary system, a BCD designation is placed to the right of the units digit. Decimal 49 10 expressed is binary is 110001 2 Decimal 49 10 expressed in BCD is 01001001 BCD

A thumbwheel switch is an input device that makes use of the BCD numbering system. The input module attached to the thumbwheel has one connection for each bit s weighted value. Selected digit of decimal 8 outputs the equivalent 4 bits of BCD data 1000 BCD

Single Digit Thumbwheel Switch Simulation Decimal Settings Binary Input

Double Digit Thumbwheel Switch Simulation Decimal Settings Binary Input

PLCs contain number conversion functions. The Convert-to-BCD instruction will convert the binary bit pattern at the source address, N7:23, into a BCD bit pattern of the same decimal value and store it at the destination address, O:20.

Many PLCs allow you to change the format of the data that the data monitor displays. The change radix function found on Allen-Bradley controllers allows you to change the display format of data to binary, octal, decimal, or hexadecimal.

Change Radix Function Simulation

3.7 Gray Code

The Gray code is set up so that as we progress from one number to the next, only one bit changes. Each position does not have a definite weight. This can be quite confusing for counting circuits, but it is ideal for encoder circuits.

Gray codes are used with position encoders for accurate control of the motion of robots, machine tools, and servomechanisms. Since only one bit changes at a time, the Gray code is considered to be an error-minimizing code.

Optical encoder disk that uses a 4-bit Gray code. The encoder disk is attached to a rotating shaft and outputs a digital Gray code signal that is used to determine the position of the shaft.

3.8 ASCII Code

ASCII stands for American Standard Code for Information Interchange. It is an alphanumeric code because it includes letters as well as numbers.

The keystrokes on the keyboard of a computer are converted directly into ASCII for processing by the computer. The communication interfacing is done through either an RS-232 or RS-422 protocol. ASCII input modules convert ASCII code input information from an external device to alphanumeric information that the PLC can process.

3.9 Parity Bit

Some PLC communication systems use a binary bit to check the accuracy of data transmission. When data are transferred between PLCs, one of the binary digits may be accidentally changed from a 1 to a 0. A parity bit is used to detect errors that may occur while a word is moved.

Parity is a system in which each character transmitted contains one additional parity bit. The parity bit may be a 0 or 1, depending on the number of 1s and 0s in the character itself. Odd parity means that the total number of binary 1 bits in the character, including the parity bit, is odd. Even parity means that the number of binary 1 bits in the character, including the parity bit, is even.

3.10 Binary Arithmetic

When adding with binary numbers, there are only four conditions that can occur:

To subtract from larger binary numbers, subtract column by column, borrowing from the adjacent column when necessary. When borrowing from the adjacent column, there are now two digits, i.e., 0 borrow 1 gives 10.

Binary numbers can also be negative. The procedure for this calculation is identical to that of decimal numbers because the smaller value is subtracted from the larger value and a negative sign is placed in front of the result.

There are other methods available for doing subtraction: 1 s complement and 2 s complement. Using the 1 s complement When there is a carry at the end of the result, the result is positive. When there is no carry, then the result is negative and a minus sign has to be placed in front of it.

When there is a carry at the end of the result, the result is positive. When there is no carry, then the result is negative and a minus sign has to be placed in front of it.

For subtraction using the 2 s complement, the 2 s complement is added instead of subtracting the numbers. In the result, if the carry is a 1, then the result is positive; if the carry is a 0, then the result is negative and requires a minus sign.

When multiplying binary numbers, there are only four conditions that can occur:

The process for dividing one binary number by another is the same for both binary and decimal numbers.

PLC data comparison instructions are used to compare the data stored in two words. At times, devices may need to be controlled when they are less than, equal to, or greater than other data values or set points.