Number and codes in digital systems



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

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

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

NUMBER SYSTEMS. 1.1 Introduction

Binary Numbers. Binary Octal Hexadecimal

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

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

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

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

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

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

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

3. Convert a number from one number system to another

CPEN Digital Logic Design Binary Systems

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

Chapter 2. Binary Values and Number Systems

Solution for Homework 2

Computer Science 281 Binary and Hexadecimal Review

Systems I: Computer Organization and Architecture

COMBINATIONAL CIRCUITS

Lecture 2. Binary and Hexadecimal Numbers

Useful Number Systems

Number Representation

BINARY CODED DECIMAL: B.C.D.

Number Systems. Introduction / Number Systems

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

Binary, Hexadecimal, Octal, and BCD Numbers

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

Lecture 11: Number Systems

CSI 333 Lecture 1 Number Systems

=

Chapter 1: Digital Systems and Binary Numbers

Number of bits needed to address hosts 8

Binary Representation

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

To convert an arbitrary power of 2 into its English equivalent, remember the rules of exponential arithmetic:

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

APPENDIX B. Routers route based on the network number. The router that delivers the data packet to the correct destination host uses the host ID.

Lecture 8: Binary Multiplication & Division

Binary Adders: Half Adders and Full Adders

Base Conversion written by Cathy Saxton

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

MEP Y9 Practice Book A

A Step towards an Easy Interconversion of Various Number Systems

Number Systems and Radix Conversion

Addition Methods. Methods Jottings Expanded Compact Examples = 15

THE BINARY NUMBER SYSTEM

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

Chapter 7 Lab - Decimal, Binary, Octal, Hexadecimal Numbering Systems

HOMEWORK # 2 SOLUTIO

Binary Division. Decimal Division. Hardware for Binary Division. Simple 16-bit Divider Circuit

COMPSCI 210. Binary Fractions. Agenda & Reading

Chapter Binary, Octal, Decimal, and Hexadecimal Calculations

MATH-0910 Review Concepts (Haugen)

1. Give the 16 bit signed (twos complement) representation of the following decimal numbers, and convert to hexadecimal:

Chapter 4: Computer Codes

Numbering Systems. InThisAppendix...

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

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

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

Lecture 4: Binary. CS442: Great Insights in Computer Science Michael L. Littman, Spring I-Before-E, Continued

Unsigned Conversions from Decimal or to Decimal and other Number Systems

CS201: Architecture and Assembly Language

Decimal to Binary Conversion

Positional Numbering System

DEPARTMENT OF INFORMATION TECHNLOGY

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012

Subnetting Examples. There are three types of subnetting examples I will show in this document:

NUMBER SYSTEMS. William Stallings

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

2.3 IPv4 Address Subnetting Part 2

Divide: Paper & Pencil. Computer Architecture ALU Design : Division and Floating Point. Divide algorithm. DIVIDE HARDWARE Version 1

3.3 Addition and Subtraction of Rational Numbers

Decimals and other fractions

Classless Subnetting Explained

Financial Mathematics

IP Subnetting and Related Topics A Tutorial by Chris Uriarte <chrisjur@cju.com> Updated April 2001

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

Recall the process used for adding decimal numbers. 1. Place the numbers to be added in vertical format, aligning the decimal points.

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

north seattle community college

Major Work of the Grade

2010/9/19. Binary number system. Binary numbers. Outline. Binary to decimal

Binary Number System. 16. Binary Numbers. Base 10 digits: Base 2 digits: 0 1

Integer Operations. Overview. Grade 7 Mathematics, Quarter 1, Unit 1.1. Number of Instructional Days: 15 (1 day = 45 minutes) Essential Questions

United States Naval Academy Electrical and Computer Engineering Department. EC262 Exam 1

Counting in base 10, 2 and 16

Exponents, Radicals, and Scientific Notation

This Unit: Floating Point Arithmetic. CIS 371 Computer Organization and Design. Readings. Floating Point (FP) Numbers

Welcome to Basic Math Skills!

CCNA R&S: Introduction to Networks. Chapter 9: Subnetting IP Networks

Counters are sequential circuits which "count" through a specific state sequence.

Solve addition and subtraction word problems, and add and subtract within 10, e.g., by using objects or drawings to represent the problem.

Cyber Security Workshop Encryption Reference Manual

EXPERIMENT 4. Parallel Adders, Subtractors, and Complementors

COURSE TITLE: INTRODUCTION TO COMPUTER DESIGN

Intel Hexadecimal Object File Format Specification Revision A, 1/6/88

ASCII and BCD Arithmetic. Chapter 11 S. Dandamudi

HFCC Math Lab Arithmetic - 4. Addition, Subtraction, Multiplication and Division of Mixed Numbers

IT:101 Cisco Networking Academy I Subnetting

Transcription:

Number and codes in digital systems Decimal Numbers You are familiar with the decimal number system because you use them everyday. But their weighted structure is not understood. In the decimal number system each of the ten digits, 0 through 9, represents a certain quantity (or weight ). These are base TEN numbers. Consider 5678 5x1000 + 6x100 + 7 x10 + 8 x 1 5x10 + 6x10 + 7x10 + 8x10 and for 18.25 1x10 + 8x1 + 2 x0.1 + 5 x.01 1 0-1 -2 1x10 + 8x10 + 2x10 + 5x10 Problem : Express the following as the sum of values of each digit. 1234 = 23.345 = 0.00231 = Binary Numbers The binary number system is another way of counting and it is simpler than the decimal system, since it has only two digits( 0 and 1). These are base TWO numbers. Consider 1011 (binary) = 1011 2 and for 10.001 (binary) = 10.001 2 1x8 + 0x4 + 1x2 + 1x1 1x2 + 0x2 + 1x2 + 1x2 B431 Principles of Digital Systems : Hassan Parchizadeh Page 1

1x2 + 0x1 + 0x0.5 + 0x.25 + 1x0.125 1 0-1 -2-3 1x2 + 0x2 + 0x2 + 0x2 + 1x2 Problem : Express the following as the sum of values of each digit. 1001101 = 1100.00101 = 0.001101 = Decimal To Binary Conversion We can convert a decimal number into a binary equivalent by dividing the decimal number successively by 2 and noting the remainders. The equvalent number is then found by writing these remainders in the REVERSE order. Example : Convert 37 decimal into binary. 37 / 2 = 18 remainder 1 LSB 18 / 2 = 9 remainder 0! 9 / 2 = 4 remainder 1!! 4 / 2 = 2 remainder 0!!! 2 / 2 = 1 remainder 0!!!! 1 / 2 = 0 remainder 1!!!!! MSB!!!!!! 1 0 0 1 0 1 Binary equivalent of 37 Example : Convert 0.3125 decimal into binary. 0.3125 x 2 = 0.625 Carry 0 MSB 0.625 x 2 = 1.25 Carry 1! 0.25 x 2 = 0.50 Carry 0!! 0.5 x 2 = 1.00 Carry 1!!! LSB!!!!.0 1 0 1 equivalent of 0.312 Problem : Convert the following decimals to binary form. : i. 23 ii. 49 iii) 2.525 B431 Principles of Digital Systems : Hassan Parchizadeh Page 2

Binary Arithmetic All the digital computers and microprocessors work on a binary basis, processing numbers and instructions coded in 1 and 0 patterns. Binary arithmetic is very similar to normal decimal arithmetic, perhaps even easir, since we are only dealing with 0's and 1's. The four operations are shown below :- Addition Substraction Multiplication Division 0 + 0 = 0 0-0 = 0 0 x 0 = 0 0 + 1 = 1 0-1 = 1 C=1 0 x 1 = 0 0 / 1 = 0 1 + 0 = 1 1-0 = 1 1 x 0 = 0 1 + 1 = 0 C=1 1-1 = 0 1 x 1 = 1 1 / 1 = 1 C = Carry / Borrow Example : Perform binary i. Addition ii. Subtraction iii. Multiplication and iv. Division on the 110 and 10 binary numbers. 11 i) 110 + ii) 110 - iii) 110 x iv) 10 110 10 10 10 10 1000 100 000 10 110 10 1100 00 Signed Numbers Digital Systems, such as the computer, must be able to handle both positive and negative numbers. A signed binary number consists of both sign and magnitude information. There are three ways in which signed numbers can be represented. Sign-magnitude numbers : 10001010 = - 10 In the sign-magnitude system, the negative and positive numbers have the same magnitude, but the sign bit(msb) is 1 for negative numbers. 1'S Complements of Binary Numbers 11110101 = - 10 B431 Principles of Digital Systems : Hassan Parchizadeh Page 3

positive numbers are represented in the same way as sign-magnitude numbers, but the negative numbers are 1's complement of the positive number.. The 1'S complement is found by simply changing all 1s to 0s and all 0s to 1s. 2'S Complements of Binary Numbers 11110101 + 1's complement 1 11110110 = -10 2's complement The 2'S complement is found by adding 1 to 1'S complement. In computers, the 2's complement system is the most widely used for handling signed numbers. Problem :Determine the 2'S complement for each 8-bit binary number. i. 00110111 ii. 11110000 iii. 10101010 Hexadecimal Numbers The hexadecimal system has a base of 16, that is composed of 16 digits (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E and F) where A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15. Hexadecimal to Decimal conversion Consider 1A34 1x16 + 10x16 + 3x16 + 4x16 6708 10 Problem : Express i. 1234 and ii. ABCD as the sum of values of each digit. Hexadecimal to Binary conversion Consider 1A34 0001 1010 0011 0100 1101000110100 2 Problem : Determine the binary numbers for i. 3456 16 and ii. CDEF 16. B431 Principles of Digital Systems : Hassan Parchizadeh Page 4

Binary to Hexadecimal conversion Consider 100,1110,0110,0100 4 E 6 4 4E64 16 Problem : Determine the hexadecimal numbers for the following. i. 100000001100010001 ii. 110101110010001110110 Decimal To Hexadecimal Conversion We can convert a decimal number into a hexadecimal equivalent by dividing the decimal number succesively by 16 and noting the remainders. The equvalent number is then found by writing these remainders in the REVERSE order. Example : Convert 37 decimal into binary. 650 / 16 = 40 remainder 10 10 = A 16 LSB 40 / 16 = 2 remainder 8 10 = 8 16 2 / 16= 0 remainder 2 10 = 2 16 MSB 28A 16 hexadecimal equivalent of 650 10 Problem : Determine the hexadecimal numbers for i. 56790 10 and ii. 21000 10. Note to Students : Also look at BCD (Binary Coded Decimal) and Gray Codes. B431 Principles of Digital Systems : Hassan Parchizadeh Page 5