# The largest has a 0 in the sign position and 0's in all other positions:

Save this PDF as:

Size: px
Start display at page:

Download "The largest has a 0 in the sign position and 0's in all other positions:"

## Transcription

1 10.2 Sign Magnitude Representation Sign Magnitude is straight-forward method for representing both positive and negative integers. It uses the most significant digit of the digit string to indicate the sign of the number and the rest of the digits to represent its magnitude. This means, of course, that every number represented in this fashion has one more digit--the sign digit--than the conventional number. Let us agree that a 0 in the sign position means that the number is positive. We indicate a negative by the digit resulting from the subtraction of 1 from the base of the original number. We will see later that this decision has consequences for other representation schemes. But for now, (+907) 10 = (0907) 10 (-907) 10 = (9907) 10 (+605) 8 = (0605) 8 (-605) 8 = (7605) 8 (+101) 2 = (0101) 2 (-101) 2 = (1101) 2 Suppose we are using a 16 bit word to store positive and negative numbers in sign magnitude representation. What is the largest and smallest integer that we can accomodate? The smallest has a 1 in the sign position and 1's in all other positions: ( ) 2 = ( ) 2 = (-32767) 10 The largest has a 0 in the sign position and 0's in all other positions: ( ) 2 = ( ) 2 = (+32767) 10 Although sign magnitude representation of numbers is straight forward it has two significant drawbacks. First, there are two ways to represent the number zero. There can be a positive zero and a negative zero. Second, the computer hardware necessary to do sign magnitude arithmetic is more complicated and,

3 (1)0000 So, 9567 is the additive inverse of 0433 when using four digits. Notice that 9567, a negative number, has a 9 in the most significant digit position. This is consistent with how we have defined the sign of a negative number: base - 1. In this case, the base is 10. The additive inverse in base 10 when restricted to a fixed number of digits is called the 10's complement. It can be generalized to numbers in any base, B. To find the B's complement of a number, subtract the number whose complement you want to find from the base raised to the number of digits you have to work with. Formally, we define the B's complement like this: (N') B = B D - (N) B where: (N) B is the number whose complement you want to find (N') B is the complement B is the base D is the number of digits you are working with, including the sign digit Using this technique, the complement of 150 base 10 in four digits is given by: N' = = 's Complement Representation Though we can do complement arithmetic in any base, it is binary arithmetic using 2's complement representation that is most of interest to us. To keep things simple, imagine that we are working with a four bit computer. These are the positive integers we can represent using three magnitude bits and a sign bit: Decimal Binary

4 Now, let's take the complement of these: At this point a pattern should be emerging that could save us a lot of work. Notice that in every case the complement and the original number are identical from left to right until you pass the first 1 of the original number. At that point, all the digits are opposite. The complement of 0010, for example, is This of course, is a consequence of binary arithmetic. Beginning from the left, subtracting a 0 from a 0 produces a 0. Thus all 0's in the original number remain 0's in the complement until you encounter the first 1. When this happens, subtracting a 1 from a 0 results in a borrow from the next column. So, 1 from 10 in binary is 1. The column after the first borrow occured is where the changes begin. We borrowed from this column, but this column originally had a 0 in it. So this column was forced to borrow from the column to its left and so on. Once this column borrowed

5 successfully, it became 10. But, of course, the column to its right borrowed from it and so changed it to 1. Now, if the number in the original column is 1, subtracting it from 1 produces a 0. If the number in the original column is 0, subtracting it produces 1. Here is the algorithm to find the 2's complement of a number: 1. Leave the 0's before the least significant 1 untouched. 2. Leave the least significant 1 untouched. 3. After the least significant 1, change 0's to 1's and 1's to 0's. Students often confuse 2's Complement as a representation scheme with taking the 2's complement of a number. As a representation scheme, 2's Complement is a set of numbers. The number of members in this set depends on how many digits we have to work with. Taking the 2's complement of a number is act of applying the algorithm just described. Thus there are positive 2's Complement numbers as well as negative 2's Complement numbers and we can find the 2's complement of each of them. Clearly, finding the 2's complement of a positive 2's Complement number produces its additive inverse, a negative 2's complement number. This scheme would not be consistent with the laws of arithmetic if the opposite were not true: finding the 2's complement of a negative 2's complement number produces the positive 2's complement number. For example, 0111, is a positive 2's complement number. Its complement is Now using the algorithm above, the complement of 1001 is 0111 as predicted. Here is the table of binary numbers and their complements using four bits. Decimal Binary 2's Complement

6 Using 2's Complement representation and four bits, we can represent numbers from -8 to +7 in base 10. Can you see why there is no 2's Complement representation for +8 base 10 in four bits. This is an improvement over sign magnitude representation for two reasons. First, there is a single representation for 0. Second, 2's Complement is a positional number scheme not a code. To convince yourself of this. Try adding -5 and +2 in 2's Complement representation: is -3 in 2's Complement, just as we would expect Storing Characters Although we can store signed and unsigned numbers to varying degrees of precision on a computer, this is not the end of the story. A computer manipulates textual data as well. This text, for instance, is being written using a word processor on a microcomputer. Somehow, the letters and punctuation symbols, as typed are transformed into strings of 1's and 0's and stored in the computer. Clearly, these letters and punctuation symbols--let's call them "characters"--are encoded and then decoded when the time comes to print the document out. The only real requirement for an encoding scheme is that it be unambiguous. If we assign a string of bits

7 to a letter, we cannot assign that same string of bits to another letter. One encoding scheme that fulfills this requirement is ASCII, and acronym for American Standard Code for Information Interchange. ASCII is a seven bit code. It represents character data as strings of seven 1's and 0's. This means that we can use ASCII to encode 2 7 different characters. These 128 characters are shown in the ASCII table handed out in class. The table has four groups of three columns. The leftmost column shows hexadecimal code for a given character. IF we translate this to binary and ignore the most significant bit, we will have the actual string of 1's and 0's stored in memory. The middle column shows the decimal equivalent of the hexadecimal code. The rightmost column shows the character that the hexadecimal code represents. For example, find decimal code 84 in the third group of columns. The hexadecimal code here is 54. Since (54) 16 = (84) 10, we can see that the decimal code is listed for convenience only. The binary eqivalent of hexadecimal 54 is The least significant seven bits of this binary number is the ASCII code for upper case "T". The characters encoded through ASCII are: 26 upper case alphabetic characters 26 lower case alphabetic characters 32 punctuation and miscellaneous symbols 10 numeric characters 34 control characters Notice that the binary code for each of the alphabetic characters is one greater than that of the preceding character. For example, the upper case characters range from hex 41 for "A" through hex 5A for "Z". The actual ASCII codes are through This means that sorting operations on alphbetic data can be done using arithmetic operations: "A" comes before "B" and comes before Notice also the relationship between the codes for upper and lower case alphabetic characters: Character Hex Code Character Hex Code A 41 a 61 B 42 b 62

8 Y 59 y 79 Z 5A z 7A Since ASCII encodings are just strings of 1's and 0's, they can be treated as binary numbers. We can, therefore, translate from upper case to lower case by adding (20) 16 to the upper case character. But let's look more closely. The following table shows not just the hexadecimal code, but its binary equivalent. Character Hex Binary Character Hex Binary A a B b Y y Z 5A z 7A Notice that the upper case letter differs from the lower case equivalent in the fifth bit where the least significant bit is designated the zeroth. So, we can convert from upper case to lower case by changing the fifth bit from 0 to 1. We can convert from lower to upper case by changing the fifth bit from 1 to 0. It is important not to be misled by the ASCII representations of the numeric characters. These are codes, not numbers. They are used for encoding numbers on which computations will not be performed. Finally, the control characters are used to send messages to hardware devices. Hex 0D, for example, is the encoding for a carriage return character. When an output device encounters this character, it begins to display text on the next line. Because ASCII is a seven bit code, we can store one ASCII encoded character in a byte. We will discuss a possible use to which the most significant bit might be put in the next section. For now, assume it is a zero. Here is the ASCII encoding for the "computer" starting at hexadecmial address : Address Character Hex Code As Stored

9 "c" "o" 6F "m" 6D "p" "u" "t" "e" "r"

10

### Computer Science 281 Binary and Hexadecimal Review

Computer Science 281 Binary and Hexadecimal Review 1 The Binary Number System Computers store everything, both instructions and data, by using many, many transistors, each of which can be in one of two

### Chapter II Binary Data Representation

Chapter II Binary Data Representation The atomic unit of data in computer systems is the bit, which is actually an acronym that stands for BInary digit. It can hold only 2 values or states: 0 or 1, true

### Encoding Systems: Combining Bits to form Bytes

Encoding Systems: Combining Bits to form Bytes Alphanumeric characters are represented in computer storage by combining strings of bits to form unique bit configuration for each character, also called

### 1 Basic Computing Concepts (4) Data Representations

1 Basic Computing Concepts (4) Data Representations The Binary System 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. The

### By the end of the lecture, you should be able to:

Extra Lecture: Number Systems Objectives - To understand: Base of number systems: decimal, binary, octal and hexadecimal Textual information stored as ASCII Binary addition/subtraction, multiplication

### Computer Number Systems

Computer Number Systems Thorne, Edition 2 : Section 1.3, Appendix I (Irvine, Edition VI : Section 1.3) SYSC3006 1 Starting from What We Already Know Decimal Numbers Based Number Systems : 1. Base defines

### Binary Numbers. X. Zhang Fordham Univ.

Binary Numbers X. Zhang Fordham Univ. 1 Numeral System! A way for expressing numbers, using symbols in a consistent manner.!! "11" can be interpreted differently:!! in the binary symbol: three!! in the

### Lecture 2. Binary and Hexadecimal Numbers

Lecture 2 Binary and Hexadecimal Numbers Purpose: Review binary and hexadecimal number representations Convert directly from one base to another base Review addition and subtraction in binary representations

### 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.

Digital Logic 1 Data Representations 1.1 The Binary System 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. The system we

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

Chapter 3 3.1 Decimal System The radix or base of a number system determines the total number of different symbols or digits used by that system. The decimal system has a base of 10 with the digits 0 through

### Decimal Numbers: Base 10 Integer Numbers & Arithmetic

Decimal Numbers: Base 10 Integer Numbers & Arithmetic Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Example: 3271 = (3x10 3 ) + (2x10 2 ) + (7x10 1 )+(1x10 0 ) Ward 1 Ward 2 Numbers: positional notation Number

### 1.3 Data Representation

8628-28 r4 vs.fm Page 9 Thursday, January 2, 2 2:4 PM.3 Data Representation 9 appears at Level 3, uses short mnemonics such as ADD, SUB, and MOV, which are easily translated to the ISA level. Assembly

### A B C

Data Representation Module 2 CS 272 Sam Houston State University Dr. Tim McGuire Copyright 2001 by Timothy J. McGuire, Ph.D. 1 Positional Number Systems Decimal (base 10) is an example e.g., 435 means

### Here 4 is the least significant digit (LSD) and 2 is the most significant digit (MSD).

Number System Introduction Number systems provide the basis for all operations in information processing systems. In a number system the information is divided into a group of symbols; for example, 26

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

Today Binary addition Representing negative numbers 2 Binary Addition Consider the following binary numbers: 0 0 1 0 0 1 1 0 0 0 1 0 1 0 1 1 How do we add these numbers? 3 Binary Addition 0 0 1 0 0 1 1

### EE 3170 Microcontroller Applications

EE 37 Microcontroller Applications Lecture 3 : Digital Computer Fundamentals - Number Representation (.) Based on slides for ECE37 by Profs. Sloan, Davis, Kieckhafer, Tan, and Cischke Number Representation

### Data Representation in Computers

Chapter 3 Data Representation in Computers After studying this chapter the student will be able to: *Learn about binary, octal, decimal and hexadecimal number systems *Learn conversions between two different

### COMP2121: Microprocessors and Interfacing

Interfacing Lecture 3: Number Systems (I) http://www.cse.unsw.edu.au/~cs2121 Lecturer: Hui Wu Session 2, 2005 Overview Positional notation Decimal, hexadecimal and binary One complement Two s complement

### Signed Binary Arithmetic

Signed Binary Arithmetic In the real world of mathematics, computers must represent both positive and negative binary numbers. For example, even when dealing with positive arguments, mathematical operations

### Binary Representation. Number Systems. Positional Notation

Binary Representation The basis of all digital data is binary representation. Binary - means two 1, 0 True, False Hot, Cold On, Off We must be able to handle more than just values for real world problems

### Part 1 Theory Fundamentals

Part 1 Theory Fundamentals 2 Chapter 1 Information Representation Learning objectives By the end of this chapter you should be able to: show understanding of the basis of different number systems show

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

Binary Representation The basis of all digital data is binary representation. Binary - means two 1, 0 True, False Hot, Cold On, Off We must be able to handle more than just values for real world problems

### Digital Fundamentals

Digital Fundamentals with PLD Programming Floyd Chapter 2 29 Pearson Education Decimal Numbers The position of each digit in a weighted number system is assigned a weight based on the base or radix of

### CPE 323 Data Types and Number Representations

CPE 323 Data Types and Number Representations Aleksandar Milenkovic Numeral Systems: Decimal, binary, hexadecimal, and octal We ordinarily represent numbers using decimal numeral system that has 10 as

### Chapter 4: Computer Codes

Slide 1/30 Learning Objectives In this chapter you will learn about: Computer data Computer codes: representation of data in binary Most commonly used computer codes Collating sequence 36 Slide 2/30 Data

### Number Systems and. Data Representation

Number Systems and Data Representation 1 Lecture Outline Number Systems Binary, Octal, Hexadecimal Representation of characters using codes Representation of Numbers Integer, Floating Point, Binary Coded

### 2.1 Binary Numbers. 2.3 Number System Conversion. From Binary to Decimal. From Decimal to Binary. Section 2 Binary Number System Page 1 of 8

Section Binary Number System Page 1 of 8.1 Binary Numbers The number system we use is a positional number system meaning that the position of each digit has an associated weight. The value of a given number

### Number Systems, Base Conversions, and Computer Data Representation

, Base Conversions, and Computer Data Representation Decimal and Binary Numbers When we write decimal (base 10) numbers, we use a positional notation system. Each digit is multiplied by an appropriate

### Lecture 2 - POGIL Activity

15213 - Lecture 2 - POGIL Activity Introduction In this activity you will learn about binary numbers. This activity was based on material developed by Professor Saturnino Garcia of the University of San

### THE BINARY NUMBER SYSTEM

THE BINARY NUMBER SYSTEM Dr. Robert P. Webber, Longwood University Our civilization uses the base 10 or decimal place value system. Each digit in a number represents a power of 10. For example, 365.42

### Number Representation and Arithmetic in Various Numeral Systems

1 Number Representation and Arithmetic in Various Numeral Systems Computer Organization and Assembly Language Programming 203.8002 Adapted by Yousef Shajrawi, licensed by Huong Nguyen under the Creative

### Lecture 2: Number System

Lecture 2: Number System Today s Topics Review binary and hexadecimal number representation Convert directly from one base to another base Review addition and subtraction in binary representation Determine

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

ECE Department Summer LECTURE #5: Number Systems EEL : Digital Logic and Computer Systems Based on lecture notes by Dr. Eric M. Schwartz Decimal Number System: -Our standard number system is base, also

### Solution for Homework 2

Solution for Homework 2 Problem 1 a. What is the minimum number of bits that are required to uniquely represent the characters of English alphabet? (Consider upper case characters alone) The number of

### NUMBERING SYSTEMS C HAPTER 1.0 INTRODUCTION 1.1 A REVIEW OF THE DECIMAL SYSTEM 1.2 BINARY NUMBERING SYSTEM

12 Digital Principles Switching Theory C HAPTER 1 NUMBERING SYSTEMS 1.0 INTRODUCTION Inside today s computers, data is represented as 1 s and 0 s. These 1 s and 0 s might be stored magnetically on a disk,

### CHAPTER 3 Number System and Codes

CHAPTER 3 Number System and Codes 3.1 Introduction On hearing the word number, we immediately think of familiar decimal number system with its 10 digits; 0,1, 2,3,4,5,6, 7, 8 and 9. these numbers are called

### Activity 1: Bits and Bytes

ICS3U (Java): Introduction to Computer Science, Grade 11, University Preparation Activity 1: Bits and Bytes The Binary Number System Computers use electrical circuits that include many transistors and

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

CS101 Lecture 11: Number Systems and Binary Numbers Aaron Stevens 14 February 2011 1 2 1 3!!! MATH WARNING!!! TODAY S LECTURE CONTAINS TRACE AMOUNTS OF ARITHMETIC AND ALGEBRA PLEASE BE ADVISED THAT CALCULTORS

### Chapter 3 DATA REPRESENTATION. 3.1 Character Representation

Chapter 3 DATA REPRESENTATION Binary codes are used to represent both characters and numbers inside computers. Moreover, the binary codes used to represent numbers must be consistent with the arithmetic

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

EE 261 Introduction to Logic Circuits Module #2 Number Systems Topics A. Number System Formation B. Base Conversions C. Binary Arithmetic D. Signed Numbers E. Signed Arithmetic F. Binary Codes Textbook

### Number Representation

Number Representation Number System :: The Basics We are accustomed to using the so-called decimal number system Ten digits ::,,,3,4,5,6,7,8,9 Every digit position has a weight which is a power of Base

### Number Representation

Number Representation COMP375 Computer Organization and darchitecture t How do we represent data in a computer? At the lowest level, a computer is an electronic machine. works by controlling the flow of

### Binary Numbers. Bob Brown Information Technology Department Southern Polytechnic State University

Binary Numbers Bob Brown Information Technology Department Southern Polytechnic State University Positional Number Systems The idea of number is a mathematical abstraction. To use numbers, we must represent

### Chapter 2: Number Systems

Chapter 2: Number Systems Logic circuits are used to generate and transmit 1s and 0s to compute and convey information. This two-valued number system is called binary. As presented earlier, there are many

### Number Systems Richard E. Haskell

NUMBER SYSTEMS D Number Systems Richard E. Haskell Data inside a computer are represented by binary digits or bits. The logical values of these binary digits are denoted by and, while the corresponding

### Note that the exponents also decrease by 1 with each column move to the right, so the

Base Systems Jacqueline A. Jones People use the decimal number system to perform arithmetic operations. Computers, on the other hand, use the binary system, which contains only two digits: 0 and 1. We

### Chapter 4. Binary Data Representation and Binary Arithmetic

Christian Jacob Chapter 4 Binary Data Representation and Binary Arithmetic 4.1 Binary Data Representation 4.2 Important Number Systems for Computers 4.2.1 Number System Basics 4.2.2 Useful Number Systems

### Useful Number Systems

Useful Number Systems Decimal Base = 10 Digit Set = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} Binary Base = 2 Digit Set = {0, 1} Octal Base = 8 = 2 3 Digit Set = {0, 1, 2, 3, 4, 5, 6, 7} Hexadecimal Base = 16 = 2

### Binary Numbers Again. Binary Arithmetic, Subtraction. Binary, Decimal addition

Binary Numbers Again Recall than N binary digits (N bits) can represent unsigned integers from 0 to 2 N -1. 4 bits = 0 to 15 8 bits = 0 to 255 16 bits = 0 to 65535 Besides simply representation, we would

### Data Representation. Data Representation, Storage, and Retrieval. Data Representation. Data Representation. Data Representation. Data Representation

, Storage, and Retrieval ULM/HHIM Summer Program Project 3, Day 3, Part 3 Digital computers convert the data they process into a digital value. Text Audio Images/Graphics Video Digitizing 00000000... 6/8/20

### Data Representation. Representing Data

Data Representation COMP 1002/1402 Representing Data A computer s basic unit of information is: a bit (Binary digit) An addressable memory cell is a byte (8 bits) Capable of storing one character 10101010

### الدكتور المھندس عادل مانع داخل

الدكتور المھندس عادل مانع داخل / میسان جامعة / كلیة الھندسة قسم الھندسة الكھرباي یة Chapter 1: Digital Systems Discrete Data Examples: 26 letters of the alphabet (A, B etc) 10 decimal digits (0, 1, 2 etc)

### Unit 2: Number Systems, Codes and Logic Functions

Unit 2: Number Systems, Codes and Logic Functions Introduction A digital computer manipulates discrete elements of data and that these elements are represented in the binary forms. Operands used for calculations

### The representation of data within the computer

The representation of data within the computer Digital and Analog System of Coding Digital codes. Codes that represent data or physical quantities in discrete values (numbers) Analog codes. Codes that

### Introduction Number Systems and Conversion

UNIT 1 Introduction Number Systems and Conversion Objectives 1. Introduction The first part of this unit introduces the material to be studied later. In addition to getting an overview of the material

Review of Number Systems The study of number systems is important from the viewpoint of understanding how data are represented before they can be processed by any digital system including a computer. Different

### Radix Number Systems. Number Systems. Number Systems 4/26/2010. basic idea of a radix number system how do we count:

Number Systems binary, octal, and hexadecimal numbers why used conversions, including to/from decimal negative binary numbers floating point numbers character codes basic idea of a radix number system

### ORG ; ZERO. Introduction To Computing

Dec 0 Hex 0 Bin 00000000 ORG ; ZERO Introduction To Computing OBJECTIVES this chapter enables the student to: Convert any number from base 2, base 10, or base 16 to any of the other two bases. Add and

### Binary Representation

Binary Representation The basis of all digital data is binary representation. Binary - means two 1, 0 True, False Hot, Cold On, Off We must tbe able to handle more than just values for real world problems

### MT1 Number Systems. In general, the number a 3 a 2 a 1 a 0 in a base b number system represents the following number:

MT1 Number Systems MT1.1 Introduction A number system is a well defined structured way of representing or expressing numbers as a combination of the elements of a finite set of mathematical symbols (i.e.,

### Digital Arithmetic. Digital Arithmetic: Operations and Circuits Dr. Farahmand

Digital Arithmetic Digital Arithmetic: Operations and Circuits Dr. Farahmand Binary Arithmetic Digital circuits are frequently used for arithmetic operations Fundamental arithmetic operations on binary

### Number Systems and Base Conversions

Number Systems and Base Conversions As you know, the number system that we commonly use is the decimal or base- 10 number system. That system has 10 digits, 0 through 9. While it's very convenient for

### CHAPTER TWO. 2.1 Unsigned Binary Counting. Numbering Systems

CHAPTER TWO Numbering Systems Chapter one discussed how computers remember numbers using transistors, tiny devices that act like switches with only two positions, on or off. A single transistor, therefore,

### Common Number Systems Number Systems

5/29/204 Common Number Systems Number Systems System Base Symbols Used by humans? Used in computers? Decimal 0 0,, 9 Yes No Binary 2 0, No Yes Octal 8 0,, 7 No No Hexadecimal 6 0,, 9, A, B, F No No Number

### Representation of Data

Representation of Data In contrast with higher-level programming languages, C does not provide strong abstractions for representing data. Indeed, while languages like Racket has a rich notion of data type

### Systems I: Computer Organization and Architecture

Systems I: Computer Organization and Architecture Lecture 2: Number Systems and Arithmetic Number Systems - Base The number system that we use is base : 734 = + 7 + 3 + 4 = x + 7x + 3x + 4x = x 3 + 7x

### Levent EREN levent.eren@ieu.edu.tr A-306 Office Phone:488-9882 INTRODUCTION TO DIGITAL LOGIC

Levent EREN levent.eren@ieu.edu.tr A-306 Office Phone:488-9882 1 Number Systems Representation Positive radix, positional number systems A number with radix r is represented by a string of digits: A n

### CHAPTER 2 Data Representation in Computer Systems

CHAPTER 2 Data Representation in Computer Systems 2.1 Introduction 47 2.2 Positional Numbering Systems 48 2.3 Converting Between Bases 48 2.3.1 Converting Unsigned Whole Numbers 49 2.3.2 Converting Fractions

### Computer is a binary digital system. Data. Unsigned Integers (cont.) Unsigned Integers. Binary (base two) system: Has two states: 0 and 1

Computer Programming Programming Language Is telling the computer how to do something Wikipedia Definition: Applies specific programming languages to solve specific computational problems with solutions

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

CDA 3200 Digital Systems Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012 Outline Data Representation Binary Codes Why 6-3-1-1 and Excess-3? Data Representation (1/2) Each numbering

### A Short Introduction to Binary Numbers

A Short Introduction to Binary Numbers Brian J. Shelburne Department of Mathematics and Computer Science Wittenberg University 0. Introduction The development of the computer was driven by the need to

### P A R T DIGITAL TECHNOLOGY

P A R T A DIGITAL TECHNOLOGY 1 CHAPTER NUMBERING SYSTEMS 1.0 INTRODUCTION This chapter discusses several important concepts including the binary, octal and hexadecimal numbering systems, binary data organization

### A First Book of C++ Chapter 2 Data Types, Declarations, and Displays

A First Book of C++ Chapter 2 Data Types, Declarations, and Displays Objectives In this chapter, you will learn about: Data Types Arithmetic Operators Variables and Declarations Common Programming Errors

### Lecture 1 Introduction, Numbers, and Number System Page 1 of 8

Lecture Introduction, Numbers and Number System Contents.. Number Systems (Appendix B)... 2. Example. Converting to Base 0... 2.2. Number Representation... 2.3. Number Conversion... 3. To convert a number

### CSc 28 Data representation. CSc 28 Fall

CSc 28 Data representation 1 Binary numbers Binary number is simply a number comprised of only 0's and 1's. Computers use binary numbers because it's easy for them to communicate using electrical current

### Integer Numbers. The Number Bases of Integers Textbook Chapter 3

Integer Numbers The Number Bases of Integers Textbook Chapter 3 Number Systems Unary, or marks: /////// = 7 /////// + ////// = ///////////// Grouping lead to Roman Numerals: VII + V = VVII = XII Better:

### Chapter 2 Numeric Representation.

Chapter 2 Numeric Representation. Most of the things we encounter in the world around us are analog; they don t just take on one of two values. How then can they be represented digitally? The key is that

### 1 Number System (Lecture 1 and 2 supplement)

1 Number System (Lecture 1 and 2 supplement) By Dr. Taek Kwon Many different number systems perhaps from the prehistoric era have been developed and evolved. Among them, binary number system is one of

### Data types. lecture 4

Data types lecture 4 Information in digital computers is represented using binary number system. The base, i.e. radix, of the binary system is 2. Other common number systems: octal (base 8), decimal (base

### The Mathematics Driving License for Computer Science- CS10410

The Mathematics Driving License for Computer Science- CS10410 Approximating Numbers, Number Systems and 2 s Complement by Nitin Naik Approximating Numbers There are two kinds of numbers: Exact Number and

### CHAPTER THREE. 3.1 Binary Addition. Binary Math and Signed Representations

CHAPTER THREE Binary Math and Signed Representations Representing numbers with bits is one thing. Doing something with them is an entirely different matter. This chapter discusses some of the basic mathematical

### CSC 1103: Digital Logic. Lecture Six: Data Representation

CSC 1103: Digital Logic Lecture Six: Data Representation Martin Ngobye mngobye@must.ac.ug Mbarara University of Science and Technology MAN (MUST) CSC 1103 1 / 32 Outline 1 Digital Computers 2 Number Systems

### Arithmetic of Number Systems

2 Arithmetic of Number Systems INTRODUCTION Arithmetic operations in number systems are usually done in binary because designing of logic networks is much easier than decimal. In this chapter we will discuss

### = Chapter 1. The Binary Number System. 1.1 Why Binary?

Chapter The Binary Number System. Why Binary? The number system that you are familiar with, that you use every day, is the decimal number system, also commonly referred to as the base-0 system. When you

### Integer and Real Numbers Representation in Microprocessor Techniques

Brno University of Technology Integer and Real Numbers Representation in Microprocessor Techniques Microprocessor Techniques and Embedded Systems Lecture 1 Dr. Tomas Fryza 30-Sep-2011 Contents Numerical

### 198:211 Computer Architecture

198:211 Computer Architecture Topics: Lecture 8 (W5) Fall 2012 Data representation 2.1 and 2.2 of the book Floating point 2.4 of the book 1 Computer Architecture What do computers do? Manipulate stored

### Two s Complement Arithmetic

Two s Complement Arithmetic We now address the issue of representing integers as binary strings in a computer. There are four formats that have been used in the past; only one is of interest to us. The

### D r = d p-1 d p-2.. d 1 d 0.d -1 d -2. D -n. EECC341 - Shaaban

Positional Number Systems A number system consists of an order set of symbols (digits) with relations defined for +,-,*, / The radix (or base) of the number system is the total number of digits allowed

### Number Representation

Number Representation CS10001: Programming & Data Structures Pallab Dasgupta Professor, Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur Topics to be Discussed How are numeric data

### EM108 Software Development for Engineers Section 5 Storing Information

EM108 5 Storing Information page 1 of 11 EM108 Software Development for Engineers Section 5 Storing Information 5.1 Motivation: Various information types o Various types of numbers o Text o Images, Audios,

### ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-470/570: Microprocessor-Based System Design Fall 2014.

REVIEW OF NUMBER SYSTEMS Notes Unit 2 BINARY NUMBER SYSTEM In the decimal system, a decimal digit can take values from to 9. For the binary system, the counterpart of the decimal digit is the binary digit,

### Numbers represented using groups of bits (1s and 0s) are said to be BINARY NUMBERS. Binary numbers are said to be in base 2.

DATA REPRESENTATION All data used by computers is in code form, based on the two digits 0 and 1. This is so, in order to reflect the two-state components of which these digital systems are made. Numbers

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

LSN 2 Number Systems Department of Engineering Technology LSN 2 Decimal Number System Decimal number system has 10 digits (0-9) Base 10 weighting system... 10 5 10 4 10 3 10 2 10 1 10 0. 10-1 10-2 10-3

### Bits, Data Types, and Operations. University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell

Bits, Data Types, and Operations University of Texas at Austin CS3H - Computer Organization Spring 2 Don Fussell How do we represent data in a computer? At the lowest level, a computer is an electronic

### Data Representation Binary Numbers

Data Representation Binary Numbers Integer Conversion Between Decimal and Binary Bases Task accomplished by Repeated division of decimal number by 2 (integer part of decimal number) Repeated multiplication

### As we have discussed, digital circuits use binary signals but are required to handle

Chapter 2 CODES AND THEIR CONVERSIONS 2.1 INTRODUCTION As we have discussed, digital circuits use binary signals but are required to handle data which may be alphabetic, numeric, or special characters.

### CS 16: Assembly Language Programming for the IBM PC and Compatibles

CS 16: Assembly Language Programming for the IBM PC and Compatibles First, a little about you Your name Have you ever worked with/used/played with assembly language? If so, talk about it Why are you taking

### 13. NUMBERS AND DATA 13.1 INTRODUCTION

13. NUMBERS AND DATA 13.1 INTRODUCTION Base 10 (decimal) numbers developed naturally because the original developers (probably) had ten fingers, or 10 digits. Now consider logical systems that only have