Number codes nibble byte word double word

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

Lecture 2: Number Systems

Digital Fundamentals

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.

Computer Organization

Data Representation COE 301. Computer Organization Prof. Muhamed Mudawar

CHAPTER 2 (b) : AND CODES

Chapter 2 Number Systems and Codes Dr. Xu

MACHINE LEVEL REPRESENTATION OF DATA

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

CHW 261: Logic Design

Beyond Base 10: Non-decimal Based Number Systems

Octal & Hexadecimal Number Systems. Digital Electronics

CC411: Introduction To Microprocessors

The type of all data used in a C++ program must be specified

1.1. INTRODUCTION 1.2. NUMBER SYSTEMS

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Positional Number System

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

Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Number Representation

Review of Number Systems

CHAPTER 2 Data Representation in Computer Systems

CHAPTER 2 Data Representation in Computer Systems

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

Using sticks to count was a great idea for its time. And using symbols instead of real sticks was much better.

Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation

Beyond Base 10: Non-decimal Based Number Systems

Objectives. Connecting with Computer Science 2

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

CMPE223/CMSE222 Digital Logic Design. Positional representation

Digital Fundamentals

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University.

Chapter 2. Data Representation in Computer Systems

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

Binary. Hexadecimal BINARY CODED DECIMAL

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

Digital Computers and Machine Representation of Data

Electronic Data and Instructions

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

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

Introduction to Numbering Systems

Number Systems and Conversions UNIT 1 NUMBER SYSTEMS & CONVERSIONS. Number Systems (2/2) Number Systems (1/2) Iris Hui-Ru Jiang Spring 2010

Microprocessors I MICROCOMPUTERS AND MICROPROCESSORS

SE311: Design of Digital Systems

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

COMP Overview of Tutorial #2

COMP2121: Microprocessors and Interfacing. Number Systems

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

Digital Logic Lecture 2 Number Systems

CMPS 10 Introduction to Computer Science Lecture Notes

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

Inf2C - Computer Systems Lecture 2 Data Representation

Intermediate Programming & Design (C++) Notation

Number System. Introduction. Decimal Numbers

umber Systems bit nibble byte word binary decimal

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

Numbering systems. Dr Abu Arqoub

Fundamentals of Programming (C)

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

1010 2?= ?= CS 64 Lecture 2 Data Representation. Decimal Numbers: Base 10. Reading: FLD Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Digital Fundamentals

Lecture (02) Operations on numbering systems

DATA REPRESENTATION. By- Neha Tyagi PGT CS KV 5 Jaipur II Shift, Jaipur Region. Based on CBSE curriculum Class 11. Neha Tyagi, KV 5 Jaipur II Shift

Number Systems & Encoding

Computer Architecture and System Software Lecture 02: Overview of Computer Systems & Start of Chapter 2

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

D I G I T A L C I R C U I T S E E

Logic and Computer Design Fundamentals. Chapter 1 Digital Computers and Information

Final Labs and Tutors

Chapter 2 Data Representations

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 01, SPRING 2013

a- As a special case, if there is only one symbol, no bits are required to specify it.

LING 388: Computers and Language. Lecture 5

Chapter 3 DATA REPRESENTATION

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

Chapter 1 Emad Felemban

2. MACHINE REPRESENTATION OF TYPICAL ARITHMETIC DATA FORMATS (NATURAL AND INTEGER NUMBERS).

Representing Characters, Strings and Text

Number representations

The type of all data used in a C (or C++) program must be specified

UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS

in this web service Cambridge University Press

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

Information Science 1

Module 1: Information Representation I -- Number Systems

DIGITAL SYSTEM DESIGN

Korea University of Technology and Education

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

Slide Set 1. for ENEL 339 Fall 2014 Lecture Section 02. Steve Norman, PhD, PEng

CS/EE 260. Digital Computers Organization and Logical Design

COMPUTER ARCHITECTURE AND ORGANIZATION. Operation Add Magnitudes Subtract Magnitudes (+A) + ( B) + (A B) (B A) + (A B)

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

(+A) + ( B) + (A B) (B A) + (A B) ( A) + (+ B) (A B) + (B A) + (A B) (+ A) (+ B) + (A - B) (B A) + (A B) ( A) ( B) (A B) + (B A) + (A B)

Digital Systems and Binary Numbers

Binary Codes. Dr. Mudathir A. Fagiri

Microcomputers. Outline. Number Systems and Digital Logic Review

Bits. Binary Digits. 0 or 1

NUMBER SYSTEMS AND CODES

TOPICS. Other Number Systems. Other Number Systems 9/9/2017. Octal Hexadecimal Number conversion

Data Representation 1

Transcription:

Codes

Number codes Digital circuits (like processors) represent information with two-valued binary codes. Why? Every signal wire in a digital system can transport one binary digit, or bit. A signal at or near system ground is said to be transporting a 0 bit. A signal at or near Vdd, a 1 bit. All information is represented using one or more signals that can transport a 0 or 1. A collection of related signals that are logically considered as a single data element is called a bus. An n-bit bus can transport n bits representing an n-bit binary number. An n-bit number can have one of 2 n different values. A 4-bit number is typically called a nibble; b bits, a byte; 16 bits, a word, and 32 bits, a double word. Since 32-bit processors are now the most typical, a 32-bit value is called a word as well. (The term word is contextual, and typically refers to the bus size of the system). Memory system size is most often referred to in terms of bytes. 1 byte has 8 bits, and can represent 2 8 or 256 different numbers (0 255). Larger numbers need more bits.

Number codes Common number bases include base 2 (binary numbers), base 10 (decimal numbers), and base 16 (hexadecimal numbers). 0 0 0 0 0 0 0 0 1 1 0 0 1 0 2 0 0 1 1 3 0 1 0 0 4 0 1 0 1 5 0 1 1 0 6 0 1 1 1 7 1 0 0 0 8 1 0 0 1 9 1 0 1 0 A 1 0 1 1 B 1 1 0 0 C 1 1 0 1 D 1 1 1 0 E 1 1 1 1 F Base 10 Base 16 Base 2 Base 2 and base 16 numbers both directly show signal/bit values. Base 16 numbers are one-to-one replacements for 4-bit binary numbers. They are more compact and convenient than binary.

Number codes Common number bases include base 2 (binary numbers), base 10 (decimal numbers), and base 16 (hexadecimal numbers). 0 0 0 0 0 0 0 0 1 1 0 0 1 0 2 0 0 1 1 3 0 1 0 0 4 0 1 0 1 5 0 1 1 0 6 0 1 1 1 7 1 0 0 0 8 1 0 0 1 9 1 0 1 0 A 1 0 1 1 B 1 1 0 0 C 1 1 0 1 D 1 1 1 0 E 1 1 1 1 F Base 16 Base 10 Base 2 Base 2 and base 16 numbers both directly show signal/bit values. Base 16 numbers are one-to-one replacements for 4-bit binary numbers. They are more compact and convenient than binary. Consider this number which form is easier to use?

Number codes Common number bases include base 2 (binary numbers), base 10 (decimal numbers), and base 16 (hexadecimal numbers). 0 0 0 0 0 0 0 0 1 1 0 0 1 0 2 0 0 1 1 3 0 1 0 0 4 0 1 0 1 5 0 1 1 0 6 0 1 1 1 7 1 0 0 0 8 1 0 0 1 9 1 0 1 0 A 1 0 1 1 B 1 1 0 0 C 1 1 0 1 D 1 1 1 0 E 1 1 1 1 F Base 10 Base 16 Base 2 Base 2 (binary) and base 16 (hex) numbers both directly show signal/bit values. Base 16 numbers are one-to-one replacements for 4-bit binary numbers. They are more compact and convenient than binary. Consider this number which form is easier to use? A D 4 6 5 B AD465B

Number systems use positional weighting. The value of a multi-digit number is the sum of the digit multiplied by the base raised to the power of the digit s position. In the examples below, d and h are added to the numbers to make it clear which radix (base) the number us using. This is the case for any base. Digit Base Position 342d = 3 x 10 2 + 4 x 10 1 + 2 x 10 0 A2Fh = A x 16 2 + 2 x 16 1 + F x 16 0 = 10 x 256 + 2 x 16 + 15 x 1 = 2607d 10101b = 1 x 2 4 + 0 x 2 3 + 1 x 2 2 + 0 x 2 1 + 1 x 2 0 = 1 x 16 + 0 + 1 x 4 + 0 + 1 x 1 = 21d

Converting from any base to base 10 is straight-forward as illustrated above. Converting from base 10 to any other base can follow a simple formula. Modulo-divide the number to be converted by the desired base, and record the quotient and remainder. Then continue dividing the most recent quotient by the base and recording the remainders until the quotient is zero. The remainders are the digits of the number in the new base, with the last-produced remainder being the most significant digit. This works for any base. Quotients Remainders 2607 = 162 x 16 + 15 (F) 162 = 10 x 16 + 2 (2) = A2Fh 10 = 0 x 16 + 10 (A) 21 = 10 x 2 + 1 10 = 5 x 2 + 0 5 = 2 x 2 + 1 =10101b 2 = 1 x 2 + 0 1 = 0 x 1 + 1

Other Number Codes Binary Coded Decimal is a four-bit binary number code used to represent decimal numbers. Only the first 10 4-bit binary numbers are used (0000 through 1001); the other six binary numbers (1010 through 1111) are ignored. Packed BCD places two BCD digits in one byte; unpacked BCD places one BCD digit in one byte. 0 0 0 0 0 0 0 1 0 0 1 1 0 0 1 0 0 1 1 0 0 1 1 1 0 1 0 1 0 1 0 0 1 1 0 0 1 1 0 1 1 1 1 1 1 0 1 1 1 0 1 0 1 1 1 0 1 1 0 0 1 0 0 0 A Gray code refers to a counting sequence where only one bit changes between consecutive numbers.

Physical digital circuits have fixed bus widths, and therefore only a finite set of numbers can be represented. An 8-bit system has only 2 8 (256) codes available to represent numbers, and a 32 bits has 2 32 (4 billion) codes available to represent numbers. Larger numbers can use double-precision, or floating point. Digital systems often represent negative numbers as well as positive numbers. How? Two s compliment Overflow and Underflow

Character codes Characters must also be represented. ASCII (American Standard Code for Information Interchange) is a 7-bit code that was developed in 1962 to define 128 alphanumeric characters used by teleprinters using American English. Later versions added an 8 th bit and more characters, but these never enjoyed widespread use. Unicode is an updated code that incorporates ASCII into its first 128 characters. Unicode currently defines more than 136,000 characters. UTF-8 is a subset used by many websites; it is an 8-bit code with ASCII as the first 128 characters. Keyboards have their own unique scan codes that were developed to make the keyboard scanning circuits more efficient. ESC 76 F1 05 F2 06 F3 04 F4 0C F5 03 F6 0B F7 83 F8 0A F9 01 F10 09 F11 78 F12 07 E0 75 ` ~ 0E 1! 16 2 @ 1E 3 # 26 4 $ 25 5 % 2E 6 ^ 36 7 & 3D 8 * 3E 9 ( 46 0 ) 45 - _ 4E = + 55 BackSpace 66 E0 74 TAB 0D Caps Lock 58 Shift 12 Q 15 A 1C W 1D Z 1Z S 1B X 22 E 24 D 23 R 2D C 21 F 2B T 2C V 2A G 34 B 32 Y 35 H 33 U 3C N 31 J 3B I 43 M 3A K 42, < 41 O 44 L 4B P 4D >. 49 ; : 4C [ { 54 /? 4A ' " 52 ] } 5B \ 5D Enter 5A Shift 59 E0 6B E0 72 Ctrl 14 Alt 11 Space 29 Alt E0 11 Ctrl E0 14