Application Programs ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning.

Slides:



Advertisements
Similar presentations
Conversion and Coding (12)10.
Advertisements

Computer Codes Rohit Khokher. Computer Codes Data types NumericNonnumeric IntegerRealAlphabet A, B, C, …,Z a, b, c,…,z Digits 0,…,9 Special Characters.
Introduction to Computer Engineering by Richard E. Haskell BCD Arithmetic Module M16.5 Section 10.4.
Floating-Point Arithmetic ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
NUMBERS DESCRIBE THE SYSTEM
Input/Output Ports and Interfacing ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning.
Microprocessor and Microcontroller Fundamentals
Lecture - 2 Number systems and computer data formats
Company LOGO Edit your slogan here DKT 122/3 DIGITAL SYSTEM 1 WEEK #3 NUMBER SYSTEMS, OPERATION & CODES (PART 2)
Codes and Code Converters
1 Number Systems. 2 Numbers Each number system is associated with a base or radix – The decimal number system is said to be of base or radix 10 A number.
Microcontroller Architecture PIC18F Family
ASCII & Gray Codes.
Binary Numbers.
FIGURES FOR CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Lecture – 5 Assembly Language Programming
COMPUTER FUNDAMENTALS David Samuel Bhatti
Revision Introductory Lesson
Data Converters ELEC 330 Digital Systems Engineering Dr. Ron Hayne
Lecture 6 Topics Character codes Error Detection and Correction
Conversion Between Lengths Positive number pack with leading zeros +18 = = Negative numbers pack with leading ones -18 =
Stacks and Subroutines ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning.
COMPUTER NUMBER SYSTEMS & DIGITAL DEVICES By: Sohaib Rehman.
Combinational Design ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
1 Lecture 5 Floating Point Numbers ITEC 1000 “Introduction to Information Technology”
Pharmacology I Math Review.
Binary Arithmetic & Data representation
Programming and Problem Solving ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning.
Number Systems ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
Number Systems Ron Christensen CIS 121.
1 Chapter 2 Number Systems, Operations, and Codes.
Number systems, Operations, and Codes
NUMBER SYSTEM Decimal System Binary System. We use two digits in this system (0,1) just like the existing system of computers.. And write the number in.
CPS120: Introduction to Computer Science Computer Math: Converting to Decimal.
© 2010 Cisco Systems, Inc. All rights reserved. 1 Network Math.
Copyright © 2002 Delmar Thomson Learning Chapter 4 Number Systems.
Data Representation, Number Systems and Base Conversions
Octal to Decimal Hexadecimal DecimalOctal Binary.
Programming Logic Controllers Number Systems and Codes - Chapter 3.
CDP ECE Spring 2000 ECE 291 Spring 2000 Lecture 2: Number Systems & x86 Instructions Constantine D. Polychronopoulos Professor, ECE Office: 463.
Codes Octal Power Hexadecimal ASCII BCD Code
Introduction to Microprocessors Chapter 2. Decimal or Base 10 Numbers  Have ten different digits (0-9)  It is a weighted number system. Each position.
Assembly Language for Intel-Based Computers, 4 th Edition Unpacked and Packed Integers (c) Pearson Education, All rights reserved. You may modify.
School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor DKT 122/3 - DIGITAL SYSTEM I Chapter.
Microcontroller Applications ELEC 421 Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Section 5 Digital Electronic Circuits. Chapter 32 Binary Number System.
Computer Data Formats Microprocessor Course Electrical Engineering Department University of Indonesia.
Arithmetic Chapter 4 Subject: Digital System Year: 2009.
Exercise 1.2 (Chapter 1) Prepared by Dr. Lamiaa Elshenawy
Interrupts ELEC 330 Digital Systems Engineering Dr. Ron Hayne
Interrupts ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning.
Digital Logic Design Lab 1,2 By Nora Alaqeel.
Chapter 32 Binary Number System. Objectives After completing this chapter, you will be able to: –Describe the binary number system –Identify the place.
COMPUTER ARITHMETIC Binary Coded Decimal Presented By Chung Wai Chow.
Unit I From Fundamentals of Logic Design by Roth and Kinney.
Programmable Logic Controller
Microprocessor and Microcontroller Fundamentals
Lecture – 5 Assembly Language Programming
Octal to Decimal Decimal Octal Binary Hexadecimal.
Binary Positional Notation
Number systems and codes
Number Systems.
Number Systems.
Multiplication and Division by Powers of Ten
BCD = Binary Coded Decimal
Table 1.1 Powers of Two.
Number Systems Rayat Shikshan Sanstha’s
Number Systems.
Counter Fundamentals Presented by :
Presentation transcript:

Application Programs ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning

Application Programs  BCD to Binary Conversion  Binary to BCD Conversion  ASCII Code to Binary Conversion  Binary to ASCII Code Conversion  Multiplication of 16-bit Numbers  Division of Two Unsigned Numbers

BCD to Binary Conversion  Data often entered in decimal format  A through F are invalid  Special care taken to process the data in BCD Sometimes necessary to convert the BCD data into binary numbers

BCD to Binary Conversion  Problem statement Given a packed BCD number in WREG Write a subroutine to unpack the number Convert it into its equivalent binary number Return the number in WREG

BCD to Binary Conversion  Problem analysis The BCD numbers include only ten digits from 0 to 9 The value of the digit is based on its position Example, in decimal number 97, the value of 9 is 90 To find the binary value of 97 BCD = Unpack the number  9 ( ) and 7 ( ) Multiply high-order digit by 10 and add low-order digit  ( ) x 10 + ( )

Unpack 330_016 OpcodeOperandsComments MOVWFREG1;Save BCD ANDLW0x0F;Mask high digit MOVWFBCD0;Save low digit MOVFREG1,W;Get saved BCD SWAPFWREG,W;Swap digits ANDLW0x0F;Mask low digit MOVWFBCD1;Save high digit

Convert 330_017 OpcodeOperandsComments MULLWD’10’;Multiply high digit MOVFFPRODL,WREG;Move product ADDWFBCD0,W;Add low digit RETURN

PIC18 Simulator 330_018