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



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

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

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

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

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

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

Systems I: Computer Organization and Architecture

Section 1.4 Place Value Systems of Numeration in Other Bases

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

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

3. Convert a number from one number system to another

Chapter 4: Computer Codes

Base Conversion written by Cathy Saxton

The use of binary codes to represent characters

Cyber Security Workshop Encryption Reference Manual

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

ASCII Code. Numerous codes were invented, including Émile Baudot's code (known as Baudot

118 One hundred Eighteen

Binary Representation

Encoding Text with a Small Alphabet

Copyright Peter R. Rony All rights reserved.

Number and codes in digital systems

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

Chapter 1: Digital Systems and Binary Numbers

(Refer Slide Time: 00:01:16 min)

The Subnet Training Guide

Binary, Hexadecimal, Octal, and BCD Numbers

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

Accuplacer Arithmetic Study Guide

Lecture 11: Number Systems

Number Systems. Introduction / Number Systems

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

=

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

Memory is implemented as an array of electronic switches

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

Numbering Systems. InThisAppendix...

Modbus Protocol. PDF format version of the MODBUS Protocol. The original was found at:

Gray Code Generator and Decoder by Carsten Kristiansen Napier University. November 2004

The Answer to the 14 Most Frequently Asked Modbus Questions

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

CPEN Digital Logic Design Binary Systems

Parallel Port Interfacing with Switches, Keypad and Rotatory encoder

6 The Hindu-Arabic System (800 BC)

Sources of electricity

Sources of electricity

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

Count the Dots Binary Numbers

Decimal to Binary Conversion

Binary Numbers. Binary Octal Hexadecimal

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

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

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

ARINC 429 Protocol Tutorial

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

Design Project: Power inverter

Global Medical Power Supply Equipment Industry Market Research Report

Global Personal Care Packaging Industry 2016 Market. Research Report

ARINC429. Specification Tutorial

Chapter 2: Basics on computers and digital information coding. A.A Information Technology and Arts Organizations

LONDON SCHOOL OF HYGIENE & TROPICAL MEDICINE

Whole Number and Decimal Place Values

Prerequisite knowledge Students should have a good understanding of how our decimal number system works as well as understand place value.

Global Packaging Films Industry 2015 Market Research. Report

Global Packaging Films Industry 2015 Market Research. Report

Number Representation

Global Passenger Information System Industry Market Research Report

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

Today s topics. Digital Computers. More on binary. Binary Digits (Bits)

BINARY CODED DECIMAL: B.C.D.

Chapter 5. Binary, octal and hexadecimal numbers

Global Benchmarking Mining Equipment Industry Market Research Report

Modicon Modbus Protocol Reference Guide. PI MBUS 300 Rev. J

Counting in base 10, 2 and 16

Global IP VIDEO SURVEILLANCE SOFTWARE Industry Market Research Report

Asynchronous counters, except for the first block, work independently from a system clock.

COMBINATIONAL CIRCUITS

Global Automobile Antenna Industry 2015 Market Research. Report

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

Global Nylon Filter Industry 2015 Market Research Report

Asynchronous Counters. Asynchronous Counters

Decimal Number (base 10) Binary Number (base 2)

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

Technical Support Bulletin Nr.18 Modbus Tips

A Step towards an Easy Interconversion of Various Number Systems

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

Module 3: Floyd, Digital Fundamental

Lab 17: Building a 4-Digit 7-Segment LED Decoder

Chapter 1. Binary, octal and hexadecimal numbers

Interfacing To Alphanumeric Displays

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

Data Storage. Chapter 3. Objectives. 3-1 Data Types. Data Inside the Computer. After studying this chapter, students should be able to:

Third Southern African Regional ACM Collegiate Programming Competition. Sponsored by IBM. Problem Set

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

CHAPTER 5. Obfuscation is a process of converting original data into unintelligible data. It

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

Global Coextruded multilayer film Industry 2015 Market. Research Report

Global V-Belt Sheaves Industry 2015 Market Research. Report

Transcription:

Digital codes This worksheet and all related files are licensed under the Creative Commons Attribution License, version 1.0. To view a copy of this license, visit http://creativecommons.org/licenses/by/1.0/, or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. The terms and conditions of this license allow for free copying, distribution, and/or modification of all licensed works by the general public. Resources and methods for learning about these subjects (list a few here, in preparation for your research): 1

Question 1 Questions Counting practice: count from zero to thirty-one in binary, octal, and hexadecimal: Zero One Two Three Four Five Six Seven Eight Nine Ten Eleven Twelve Thirteen Fourteen Fifteen Binary Octal Hex Sixteen Seventeen Eighteen Nineteen Twenty Twenty one Twenty two Twenty three Twenty four Twenty five Twenty six Twenty seven Twenty eight Twenty nine Thirty Thirty one Binary Octal Hex file 01221 2

Question 2 Rotary encoders are electromechanical devices used to convert an angular position (shaft rotation) into a digital signal. The simplest form of rotary encoder uses a slotted wheel with a single LED/photodetector pair to generate pulses as the wheel turns: Light sensor (phototransistor) LED Rotary encoder Some rotary encoder designs have multiple-bit outputs, with each LED/photodetector pair reading a different track of slots in the disk: 3-bit rotary encoder In the illustration shown above, identify which LED/photodetector pairs represent the MSB (Most Significant Bit) and LSB (Least Significant Bit) of the binary output. Also, identify which direction the wheel must turn in order to produce an increasing count. Note: assume that the darkest areas on the illustration represent slots cut through the disk, while the grey areas represent parts of the disk that are opaque. file 01236 3

Question 3 Absolute rotary encoders often use a code known as Gray code rather than binary, to represent angular position. This code was patented by Frank Gray of Bell Labs in 1953, as a means of reducing errors in rotary encoder output. Examine each of these encoder disks, and determine which one is binary and which one is Gray code: Assuming that the darkest areas on the illustration represent slots cut through the disk, and the grey areas represent parts of the disk that are opaque, mark the zero, one, and two sectors on each disk. file 01237 Question 4 Explain why Gray code is often used in rotary encoders rather than binary coding. What difference does it make what type of code we use to mark the sectors of an encoder disk, so long as each sector possesses a unique number? file 01238 Question 5 Convert the following binary numbers into Gray code: 100110 2 = 110010 2 = 101001 2 = 1010100110 2 = file 01376 4

Question 6 Convert the following Gray code numbers into binary: 111110 Gray = 100001 Gray = 101110 Gray = 1110001111 Gray = file 01377 Question 7 A nearly universal standard for representing text data in digital form is the ASCII code. What does the acronym ASCII stand for, and what is the format of this code? file 01233 Question 8 Explain how the Morse Code resembles ASCII in structure and purpose. file 01241 Question 9 Decode this set of ASCII characters, to reveal a secret message (all codes given in hexadecimal format): file 01234 Question 10 49 20 4C 6F 76 65 20 45 6C 65 63 74 72 6F 6E 69 63 73 21 Standard ASCII codes are seven bits in length, but communications equipment usually sends data in eight-bit (byte) groups. The extra bit is often used as a parity bit. What is the purpose of a parity bit, and how is it used? file 01235 Question 11 Explain why Binary Coded Decimal (BCD) is sometimes referred to as the 8421 code. Why is this code used at all? file 01239 Question 12 Convert the following decimal numbers into BCD form: 739 10 25 10 92241 10 Convert the following BCD numbers into decimal form: 1000 1001 0100 0111 0110 0011 1000 0101 0001 file 01240 5

Answer 1 Answers No answers given here compare with your classmates! Answer 2 I ll let you figure out the MSB, LSB, and up-count direction on your own! It isn t difficult to do if you have mastered counting in binary. 6

Answer 3 0 1 2 0 1 2 I won t directly tell you which disk is which, but I will provide a comparison of 5-bit binary versus Gray code, to help you in your analysis: Binary Gray 00000 00000 00001 00001 00010 00011 00011 00010 00100 00110 00101 00111 00110 00101 00111 00100 01000 01100 01001 01101 01010 01111 01011 01110 01100 01010 01101 01011 01110 01001 01111 01000 10000 11000 10001 11001 10010 11011 10011 11010 10100 11110 10101 11111 10110 11101 10111 11100 11000 10100 7

Answer 4 11001 10101 11010 10111 11011 10110 11100 10010 11101 10011 11110 10001 11111 10000 Gray code markings are more tolerant of sensor misalignment than binary markings, because there is no need for perfect synchronization of multiple bit transitions between sectors. Answer 5 100110 2 = 110101 Gray 110010 2 = 101011 Gray 101001 2 = 111101 Gray 1010100110 2 = 1111110101 Gray Answer 6 111110 Gray = 101011 2 100001 Gray = 111110 2 101110 Gray = 110100 2 1110001111 Gray = 1011110101 2 Answer 7 ASCII = American Standard Code for Information Interchange. Basic ASCII is a seven-bit binary code capable of representing all alphabetical characters used in the English language (upper-case as well as lower), as well as Arabic numerals, English punctuation marks, and some miscellaneous control codes for teletype machines. Challenge question: although ASCII technically requires only 7 bits, a full 8 bits (1 byte) is usually reserved for each ASCII character in computer systems. Explain why. Answer 8 Morse Code is digital, being composed of only two types of characters, just like ASCII. Also, its purpose is to convey alphanumeric information, just like ASCII. Answer 9 I ll let you decode this message on your own! Answer 10 Parity bits are used as a primitive form of error detection. Communications equipment making use of parity for error detection may either be configured for even parity or for odd parity. I ll let you research and explain how parity bits are used in the transmission of ASCII data. 8

Answer 11 BCD uses groups of four binary bits to represent each digit of a decimal number. The LSD place weights are 8-4-2-1, while the next significant digit s place weightings are 80-40-20-10, and so on. Follow-up question: the four bits used for each BCD character could be called half of a byte (8 bits). There is a special word for a four-bit grouping. What is that word? Answer 12 739 10 = 0111 0011 1001 25 10 = 0010 0101 92241 10 = 1001 0010 0010 0100 0001 1000 1001 = 89 10 0100 0111 0110 = 476 10 0011 1000 0101 0001 = 3851 10 9

Notes 1 Notes In order to familiarize students with these strange numeration systems, I like to begin each day of digital circuit instruction with counting practice. Students need to be fluent in these numeration systems by the time they are finished studying digital circuits! One suggestion I give to students to help them see patterns in the count sequences is pad the numbers with leading zeroes so that all numbers have the same number of characters. For example, instead of writing 10 for the binary number two, write 00010. This way, the patterns of character cycling (especially binary, where each successively higher-valued bit has half the frequency of the one before it) become more evident to see. Notes 2 Ask your students to brainstorm possible applications for rotary encoders. Where might we use such a device? Also, ask them to contrast the two encoder types (1 bit versus 3-bit) shown in the question. What applications might demand the 3-bit, versus only require a 1-bit encoder? Notes 3 Ask your students what patterns they notice in the Gray code sequence, as compared to the binary count. What difference do they see between binary and Gray code, analyzing the bit transitions from one number to the next? Notes 4 This is perhaps the most important reason for using Gray code in encoder marking, but it is not necessarily obvious why to the new student. I found that making a physical mock-up of a binary-coded wheel versus a Gray-coded wheel helped me better present this concept to students. Those students with better visualization/spatial relations skills will grasp this concept faster than the others, so you might want to solicit their help in explaining it to the rest of the class. Notes 5 There are many textbook references for the conversion process between binary and Gray code. Let your students research how the conversions are done! Notes 6 There are many textbook references for the conversion process between binary and Gray code. Let your students research how the conversions are done! Notes 7 ASCII is arguably the lingua franca of the digital world. Despite its humble beginnings and Anglocentric format, it is used worldwide in digital computer and telecommunication systems. Let your students know that every plain-text computer file is nothing more than a collection of ASCII codes, one code for each text character (including spaces). Notes 8 An interesting point to bring up to students about Morse Code is that it is self-compressing. Note how different Morse characters possess different bit lengths, whereas ASCII characters are all 7 bits each (or 8 bits for Extended ASCII). This makes Morse a more efficient code than ASCII, from the perspective of bit economy! Ask your students what ramifications this self-compressing aspect of Morse Code would have if we were to choose it over ASCII for sending alphanumeric characters over digital communications lines, or store alphanumeric characters in some form of digital memory media. 10

Notes 9 Notes 10 This question provides students with practice using an ASCII reference table. The concept of parity is not very complex. It should be well within the reach of students to research on their own and report their findings to the class as a whole. Notes 11 Discuss with your students the purpose of using BCD to represent decimal quantities. While not an efficient usage of bits, BCD certainly is convenient for representing decimal figures with discrete (0 or 1) logic states. Notes 12 Nothing but straightforward conversions here! 11