Binary. Hexadecimal BINARY CODED DECIMAL

Similar documents
MACHINE LEVEL REPRESENTATION OF DATA

UNIT 7A Data Representation: Numbers and Text. Digital Data

Lecture 2: Number Systems

Experimental Methods I

Lecture (03) Binary Codes Registers and Logic Gates

Digital Fundamentals

Number System. Introduction. Decimal Numbers

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer.

1.1 Information representation

DIGITAL SYSTEM DESIGN

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two Solutions 26 February 2014

Read this before starting!


BINARY SYSTEM. Binary system is used in digital systems because it is:

Digital Systems and Binary Numbers

Chapter 1. Digital Systems and Binary Numbers

DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) COURSE / CODE NUMBER SYSTEM

Review of Number Systems

Number Systems. Dr. Tarek A. Tutunji Philadelphia University, Jordan

Logic Circuits I ECE 1411 Thursday 4:45pm-7:20pm. Nathan Pihlstrom.

Chapter 4: Computer Codes. In this chapter you will learn about:

Chapter 1 Review of Number Systems

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two 26 February 2014

Read this before starting!

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1

Lecture (01) Digital Systems and Binary Numbers By: Dr. Ahmed ElShafee

CHAPTER TWO. Data Representation ( M.MORRIS MANO COMPUTER SYSTEM ARCHITECTURE THIRD EDITION ) IN THIS CHAPTER

Lecture (02) Operations on numbering systems

User. Application program. Interfaces. Operating system. Hardware

ECE 2030D Computer Engineering Spring problems, 5 pages Exam Two 8 March 2012

SE311: Design of Digital Systems

Digital Computers and Machine Representation of Data

Signed Binary Numbers

Digital Fundamentals. CHAPTER 2 Number Systems, Operations, and Codes

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR

Fundamentals of Programming (C)

Digital Systems and Binary Numbers

Chapter 2 Number Systems and Codes Dr. Xu

UNCA CSCI 255 Exam 1 Spring February, This is a closed book and closed notes exam. It is to be turned in by 1:45 PM.

CHW 261: Logic Design

Read this before starting!

Number representations

Binary Codes. Dr. Mudathir A. Fagiri

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

Korea University of Technology and Education

ECE 2030B 1:00pm Computer Engineering Spring problems, 5 pages Exam Two 10 March 2010

Introduction to Numbering Systems

Data Representation and Binary Arithmetic. Lecture 2

Thus needs to be a consistent method of representing negative numbers in binary computer arithmetic operations.

that system. weighted value associated with it. numbers. a number. the absence of a signal. MECH 1500 Quiz 2 Review Name: Class: Date:

Read this before starting!

Lecture (01) Introduction Number Systems and Conversion (1)


Number codes nibble byte word double word

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation

Number Systems and Binary Arithmetic. Quantitative Analysis II Professor Bob Orr

Agenda EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 1: Introduction. Go over the syllabus 3/31/2010

Computer Organization

Ms Sandhya Rani Dash UNIT 2: NUMBER SYSTEM AND CODES. 1.1 Introduction

Kinds Of Data CHAPTER 3 DATA REPRESENTATION. Numbers Are Different! Positional Number Systems. Text. Numbers. Other

Chapter 3: Number Systems and Codes. Textbook: Petruzella, Frank D., Programmable Logic Controllers. McGraw Hill Companies Inc.

Excerpt from: Stephen H. Unger, The Essence of Logic Circuits, Second Ed., Wiley, 1997

CS 121 Digital Logic Design. Chapter 1. Teacher Assistant. Hadeel Al-Ateeq

Digital Systems and Binary Numbers

Logic, Words, and Integers

Moodle WILLINGDON COLLEGE SANGLI. ELECTRONICS (B. Sc.-I) Introduction to Number System

EEM336 Microprocessors I. Arithmetic and Logic Instructions

Basic Arithmetic (adding and subtracting)

Information Science 1

IBM 370 Basic Data Types

EE292: Fundamentals of ECE

LOGIC DESIGN. Dr. Mahmoud Abo_elfetouh

Physics 306 Computing Lab 5: A Little Bit of This, A Little Bit of That

The Gray Code. Script

LECTURE 4. Logic Design

NUMBER SYSTEMS AND CODES

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Microcomputers. Outline. Number Systems and Digital Logic Review

Chapter 3 DATA REPRESENTATION

IT 201 Digital System Design Module II Notes

Digital Logic Lecture 4 Binary Codes

DIGITAL ARITHMETIC: OPERATIONS AND CIRCUITS

Chapter 1 Emad Felemban

Signed umbers. Sign/Magnitude otation

Variables and Data Representation

Number Systems (2.1.1)

Objectives. Connecting with Computer Science 2

CHAPTER 2 (b) : AND CODES

Appendix. Numbering Systems. In This Appendix...

Computer Sc. & IT. Digital Logic. Computer Sciencee & Information Technology. 20 Rank under AIR 100. Postal Correspondence

SISTEMI EMBEDDED. Basic Concepts about Computers. Federico Baronti Last version:

Birkbeck (University of London) Department of Computer Science and Information Systems. Introduction to Computer Systems (BUCI008H4)

Systems Programming. Lecture 2 Review of Computer Architecture I

Memory Addressing, Binary, and Hexadecimal Review

Chapter 2. Data Representation in Computer Systems

Digital Logic Lecture 2 Number Systems

CHAPTER 2 Data Representation in Computer Systems

Digital Systems COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

CS & IT Conversions. Magnitude 10,000 1,

Appendix. Numbering Systems. In this Appendix

Transcription:

Logical operators Common arithmetic operators, like plus, minus, multiply and divide, works in any number base but the binary number system provides some further operators, called logical operators. Meaning can be assigned to the two binary states, such as yes and no, or true and false. Traditionally zero is assigned to false and one to true. Digital systems are said to be constructed by using logic gates. These gates are the AND, OR, NOT, NAND, NOR, EXOR. The basic operations are described below with the aid of truth tables. Gate AND OR NOT NAND NOR EXOR The AND gate is an electronic circuit that gives a high output (1) only if all its inputs are high. The OR gate is an electronic circuit that gives a high output (1) if one or more of its inputs are high. A plus (+) is used to show the OR operation. The NOT gate is an electronic circuit that produces an inverted version of the input at its output. It is also known as an inverter. If the input variable is A, the inverted output is known as NOT A. This is also shown as A', or A with a bar over the top, as shown at the outputs. This is a NOT-AND gate which is equal to an AND gate followed by a NOT gate. The outputs of all NAND gates are high if any of the inputs are low. The symbol is an AND gate with a small circle on the output. The small circle represents inversion. This is a NOT-OR gate which is equal to an OR gate followed by a NOT gate. The outputs of all NOR gates are low if any of the inputs are high. The symbol is an OR gate with a small circle on the output. The small circle represents inversion. The 'Exclusive-OR' gate is a circuit which will give a high output if either, but not both, of its two inputs are high. An encircled plus sign () is used to show the EOR operation.

Binary Control systems can only tell the difference between two states, zero and one, and consequently they work in a number base that only has two symbols. They work in a number system with a base of two, the binary system. Data, in whatever form, are stored in binary. Hexadecimal The hexadecimal system has a base of 16, it is often called Hex for short. Binary is difficult and unwieldy for humans to deal with. Large numbers are even larger in binary. Doing quick conversions from binary into decimal is not possible. The fact that the base value of hex (16) is a power the base value of binary (two), I.D.16 equals 2^4, makes conversion between the two systems very easy. When technicians talk to each other about the actual stored values in the system, they use hex. Suppose a particular location in a computer's memory contains 1001110110011010. To convert from binary to hex, split the number into groups of four. 1001 1101 1001 1010 Then simply take each four digit binary number, converted to the decimal and substitute in the hex symbol. Binary 1001 1101 1001 1010 Decimal 9 13 9 10 Hex 9 D 9 A Convert these numbers from binary to hexadecimal. 1111111111111111 1011011110100001 0011001001000101 0001001000110100 Convert these numbers from hex to binary F1 A1 2222 58F9 ABDE BINARY CODED DECIMAL Pure binary is not the only way of storing numbers, another way is called Binary Coded Decimal (BCD).

Binary coded decimal-is a way of representing decimal numbers using four bits to hold the binary representation of the digits 0 through to 9. Groups of four bits are used to represent decimal digits. BCD 0000 0 0001 1 0010 2 0011 3 0100 4 0101 5 0110 6 0111 7 1000 8 1001 9 Decimal Hence 319 would be represented by 0011 0001 1001 4386 would be represented by 0100 0011 1000 0110 The circuits needed to manipulate numbers stored in BCD are much more complex than those used for arithmetic operations on pure binary numbers but the advantage is that the system is actually manipulating decimal numbers which makes it easier for it to format the numbers for output. How would these decimal numbers be represented in a computer using BCD? 748 22 41 38, 972 What decimal numbers to these BCD patterns represent? 000101011000 0101011110010110 10011001 10010100000101100110

ASCII In the early days of computers the different Manufacturer's all tended to use different codes to represent letters. This made it very difficult to move information from one Manufacturer's computer to another. The American National Standards Institute created a common code that everybody could use: ASCII, or to use its full name, American Standard Code for Information Interchange. ASCII officially uses seven bits to represent letters but most computers store them as eight bits largely because of the way computers are designed. The eighth bit is often used as a parity bit to check the data has been transferred without error. It is easiest to think of ASCII data as being held in groups of eight bits, the leftmost bit always being zero. Full 4 bit (Nibble) number system Binary Decimal Hexadecimal 0000 0 0 0001 1 1 0010 2 2 0011 3 3 0100 4 4 0101 5 5 0110 6 6 0111 7 7 1000 8 8 1001 9 9 1010 10 A 1011 11 B 1100 12 C 1101 13 D 1110 14 E 1111 15 F

examples should be included. Numbers The two ways of storing numbers discussed above only store positive whole numbers (integers). What about fractions, decimals and negative numbers? Control systems need to use these for such quantities as weights and temperatures. Ways of storing binary equivalents of these values are needed. In the decimal numbering system the units column represents 2^0. Logic states therefore that any value to the right (the other side of the decimal point) have decreasing powers of 10. Fixed point The decimal point doesn't physically have to be stored as long as there is a way of finding out its position. Recall the smallest storage value in a computer is a bit. In early machines these were grouped into groups of eight bits called a byte. This was largely due to restrictions within the computers, architecture and although these restrictions have been lifted the traditional byte has remained, and consequently the storage of numbers has always been in multiples of eight bits. If all numbers are stored in 16 bits then using the fixed point method of storage this area can be defined so that a certain number of bits are to the left of the decimal point and the rest are to the right of the point. Let's assume that there are eight bits to the left of the point and eight bits to the right. Fixed point is a way of storing numbers in a computer system where the decimal point is assumed to be in a specific position. One of the problems of this method is that there is a limit to the size of a number. The biggest number using this method is 255.99609375. This number can be made bigger by changing the place of the decimal point. If there were four digits to the right and the rest to the left of the decimal point than the biggest number is 4095.9375. This is a bit better but the decimal values that can be represented are limited. This leads to less accuracy or precision. The position of the decimal point is actually a trade-off between the size of numbers and the numbers precision. Floating Point Floating point allows us to store a much larger range of numbers than fixed point but once again there is a trade-off with the precision of the number. Obviously using more bits would increase the precision of the number.