Chap 3 Data Representation

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

Systems I: Computer Organization and Architecture

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

Number Representation

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

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

Chapter 4: Computer Codes

Chapter 1: Digital Systems and Binary Numbers

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

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

Useful Number Systems

Binary Numbering Systems

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

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

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

Computer Science 281 Binary and Hexadecimal Review

Lecture 2. Binary and Hexadecimal Numbers

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

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

CSI 333 Lecture 1 Number Systems

Data Storage 3.1. Foundations of Computer Science Cengage Learning

Solution for Homework 2

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

Numbering Systems. InThisAppendix...

CPEN Digital Logic Design Binary Systems

Unsigned Conversions from Decimal or to Decimal and other Number Systems

ECE 0142 Computer Organization. Lecture 3 Floating Point Representations

This 3-digit ASCII string could also be calculated as n = (Data[2]-0x30) +10*((Data[1]-0x30)+10*(Data[0]-0x30));

COMPSCI 210. Binary Fractions. Agenda & Reading

Digital Logic Design. Introduction

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

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)

Binary Representation

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

NUMBER SYSTEMS. 1.1 Introduction

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

Number and codes in digital systems

Chapter Binary, Octal, Decimal, and Hexadecimal Calculations

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

Lecture 11: Number Systems

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

Binary, Hexadecimal, Octal, and BCD Numbers

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

Binary Numbers. Binary Octal Hexadecimal

Lecture 8: Binary Multiplication & Division

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

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

CS321. Introduction to Numerical Methods

DATA_TYPE Values and Data File Storage Formats

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

THE BINARY NUMBER SYSTEM

The New IoT Standard: Any App for Any Device Using Any Data Format. Mike Weiner Product Manager, Omega DevCloud KORE Telematics

Base Conversion written by Cathy Saxton

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

Number Systems. Introduction / Number Systems

HOMEWORK # 2 SOLUTIO

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

Pemrograman Dasar. Basic Elements Of Java

Chapter 2. Binary Values and Number Systems

Number Systems and Radix Conversion

I PUC - Computer Science. Practical s Syllabus. Contents

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

NUMBER SYSTEMS TUTORIAL

The programming language C. sws1 1

Verilog - Representation of Number Literals

Correctly Rounded Floating-point Binary-to-Decimal and Decimal-to-Binary Conversion Routines in Standard ML. By Prashanth Tilleti

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

Attention: This material is copyright Chris Hecker. All rights reserved.

THE EXACT DOT PRODUCT AS BASIC TOOL FOR LONG INTERVAL ARITHMETIC

DNA Data and Program Representation. Alexandre David

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

1. Introductory Overview

Q-Format number representation. Lecture 5 Fixed Point vs Floating Point. How to store Q30 number to 16-bit memory? Q-format notation.

A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc

CSE 2300W DIGITAL LOGIC DESIGN

Technical Support Bulletin Nr.18 Modbus Tips

1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12

A Step towards an Easy Interconversion of Various Number Systems

Sheet 7 (Chapter 10)

Chapter 5, The Instruction Set Architecture Level

Measures of Error: for exact x and approximation x Absolute error e = x x. Relative error r = (x x )/x.

NUMBERS & LOGIC. NUMBER SYSTEMS Candidate answers frequently show that they have little understanding of what constitutes a number system.

3. Convert a number from one number system to another

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

Introduction to Xilinx System Generator Part II. Evan Everett and Michael Wu ELEC Spring 2013

Numerical Matrix Analysis

CS201: Architecture and Assembly Language

1.Eastron SDM220Modbus Smart Meter Modbus Protocol Implementation V1.0

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

Gates, Plexers, Decoders, Registers, Addition and Comparison

A NEW REPRESENTATION OF THE RATIONAL NUMBERS FOR FAST EASY ARITHMETIC. E. C. R. HEHNER and R. N. S. HORSPOOL

COURSE TITLE: INTRODUCTION TO COMPUTER DESIGN

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

Digital Logic Design

Encoding Text with a Small Alphabet

Arithmetic in MIPS. Objectives. Instruction. Integer arithmetic. After completing this lab you will:

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

Chapter 5. Binary, octal and hexadecimal numbers

COMBINATIONAL CIRCUITS

Transcription:

Chap 3 Data Representation

3-11 Data Types How to representation and conversion between these data types?

3-11 Data Types : Number System Radix : Decimal : radix 10 Binary : radix 2

3-11 Data Types : Number System Octal : radix 8 Hexademical : radix 16 Distinguish radix number :

3-11 Data Types : Number System Conversion Octal <-> Decimal Hexademical <-> Decimal

3-11 Data Types : Conversion Binary <-> Decimal

3-11 Data Types : Conversion Binary <-> Decimal (44899) 10 <->Hexadecimal

3-11 Data Types : Conversion

3-11 Data Types : Conversion

3-11 Data Types : Conversion

3-11 Data Types : Conversion Binary-Coded Decimal (BCD) Number :

3-11 Data Types : Alphanumeric Rep.

3-11 Data Types : Alphanumeric Rep.

3-22 Complements Complements : (r-1) s complement : Number N, Base r, n digits -> (r-1) s complement of N is (r n -1)-N For example : r=10, (r-1)=9, (10 n -1)-N n=4, 10 4 =10000, 10 4-1=9999 9 s complements of 546700 is 999999-546700=453299 9 s complements of 12389 is 99999-12389=87610 For example: r=2, (r-1)=1, (10 n -1)-N n=4, 2 4 =(10000) 2, 2 4-1=(1111) 2 1 s complements of 1011001 is 0100110 1 s complements of 0001111 is 1110000

3-22 Complements (r s) Complements : r s complement, n-digit, number N, base r is defined as r n -N r n -N=[(r n -1)-N]+1=(r-1) s +1 For example : r=10, 2389 9 s = 7610 10 s complements of 2389=7610+1 r=2, 101100 1 s = 010011 2 s complements of 101100=010011+1=010100 Fast conversion : 10 s complement 2 s complement

3-22 Complements : Subtraction of Unsigned Numbers Subtraction :

3-22 Complements : Subtraction of Unsigned Numbers 10 s complements Subtraction :

3-22 Complements : Subtraction of Unsigned Numbers 2 s complements Subtraction :

3-33 Fixed-Point Representation Fixed-point Representation :

3-33 Fixed-Point Representation Integer Representation :

3-33 Fixed-Point Representation Signed-magnitude Representation : For example : 8-bit +/- 14 +/- zero

3-33 Fixed-Point : Arithmetic Addition Signed-magnitude System : Compare -> Add/Sub

3-33 Fixed-Point : 2 s 2 s Complement Addition 2 s complement System : Compare

3-33 Fixed-Point : 2 s 2 s Complement Addition 2 s complement System :

3-33 Fixed-Point : 2 s 2 s Complement Subtraction 2 s complement subtraction :

3-33 Fixed-Point : Overflow Overflow :

3-33 Fixed-Point : Overflow Overflow : +/-,-/+ No Overflow +/+, -/- May occur Overflow Overflow Detection :

3-33 Fixed-Point : Decimal Fixed-Point Rep. Decimal Fixed-Point Representation :

3-44 Floating-Point Representation (FP Rep.) Mantissa vs. Exponent :

3-44 Floating-Point Representation (FP Rep.) Example :

3-44 Floating-Point : Normalization FP Normalization :

3-44 Floating-Point : Normalization

3-55 Other Binary Code : Gray Code Gray Code :

3-55 Other Binary Code : Gray Code

3-55 Other Binary Code : Other Decimal Codes

3-55 Other Binary Code : Other Alphanumeric Codes ASCII : 7bit + parity EBCDIC (Extended BCD interchange code, IBM) : 8bit + parity Alphanumeric for data processing : 6bit (26 uppercase letters + 0~9 +28 special character)

3-66 Error Detection Codes

3-66 Error Detection Codes Parity Bit :

3-66 Error Detection Codes Parity Bit :

3-66 Error Detection Codes Parity Generator / Parity Checker :