# 1 Basic Computing Concepts (4) Data Representations

Save this PDF as:

Size: px
Start display at page:

## Transcription

1 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 system we use to write numbers is called decimal (or denary). In the DECIMAL system fifty two is written as 52. In the BINARY system fifty two is written as Converting from Binary to Decimal How can we convert numbers from the binary system to the decimal system? Follow this example. We have Note that this number is a sequence of 8 bits, so it is a byte. Add the weights as seen in the diagram. Add all weights that are associated with the bits that are equal to 1. Weights Number Add This amounts to 150. Sometimes we use subscripts to indicate whether a number is binary of decimal as shown here: A binary number: A decimal number: The method we have seen here is called the positional notation method. Convert the following binary numbers to decimal. a b c Comp Int Basic Computing Concepts 4 Data Representations Page 1

2 Converting from Decimal to Binary Suppose we want to convert the decimal number 149 to binary. One way we can do this is by repeatedly dividing the number by 2 and then taking the remainder digits to get the solution. An example is shown here: remainder remainder remainder remainder remainder remainder remainder 0 0 remainder 1 Quotient after dividing by 2 Remainder after dividing by 2 After performing this process you have to read the remainders FROM BOTTOM TO TOP. This gives us that the decimal number 149 is equal to the binary number Convert the following decimal numbers to binary. a. 108 b. 53 c. 74 Number Bases Positional number systems depend on a special number called a base. A positional number system (like the decimal and binary systems) is such that a digit represents a number according to the position where it is e.g. in the number 2725 the first 2 (from the left) represents 2000 while the second 2 represents 20. Note that: 2725 = 2x x x = 2x x x x10 0. Comp Int Basic Computing Concepts 4 Data Representations Page 2

3 The base number of the decimal system is 10. Working on the same principles we can show that the base number of the binary system is 2. Let us investigate the number = 1x x64 + 0x32 + 1x16 + 0x8 + 1x4 + 1x2 + 0x = 1x x x x x x x x2 0. Note also that the base number shows us how many different symbols are required to express a number i.e. in the decimal system we need 10 symbols (0, 1, 2, 3, 4, 5, 6, 7, 8 and 9) while in the binary system we need 2 (0 and 1). Adding and Subtracting Binary Numbers The following example shows two numbers being added: Carry First number Second number Result of addition 1 Step 1: gives 1 Carry 1 First number Second number Result of addition 0 1 Carry 1 1 First number Second number Result of addition Step 2: gives 0 carry 1 Carry First number Second number Result of addition Step 3: gives 0 carry Proceeding in this way we get: Carry First number Second number Result of addition Step 4: gives 1 carry 1 Comp Int Basic Computing Concepts 4 Data Representations Page 3

4 in Addition Add the following binary numbers. Then check your result by using decimal numbers. a and b and The following example shows subtraction: Borrow First number Second number Result of subtraction 1 Step 1: 1 0 gives 1 Borrow First number Second number Result of subtraction 0 1 Borrow 2 First number Second number Result of subtraction Step 2: 1 1 gives Proceeding in this way we get Borrow First number Second number Result of subtraction Step 3: 0-1 means that we have to borrow in Subtraction Perform the following binary subtractions. Then check your results by using decimal numbers: Hexadecimal Numbers a b Hexadecimal numbers are based on the number 16. A hexadecimal number uses 16 symbols which are 0, 1, 2 8, 9, A, B, C, D, E and F. A stands for ten, B stands for eleven, C stands for twelve etc. The term hexadecimal is shortened to hex. Hex numbers are used as a shortcut notation for binary numbers. The conversions from binary to hex and vice-versa are very simple and straightforward. Comp Int Basic Computing Concepts 4 Data Representations Page 4

5 In the following table we can see the representations of the numbers from zero to fifteen in all three bases. An example of a hex (hexadecimal) number: 3C90B. Conversion from decimal to hexadecimal The following example shows how the decimal number 400 is converted to hex. Conversion from Hex to Binary In the following example the hex number 190 is converted to binary. Comp Int Basic Computing Concepts 4 Data Representations Page 5

6 Conversion from binary to hex It is easy to convert from an integer binary number to hex. This is accomplished by the following two steps: 1. Break the binary number into 4-bit sections from the LSB (least significant bit) to the MSB (most significant bit). 2. Convert the 4-bit binary number to its Hex equivalent. The following example shows how the binary value is converted to hex A F B 2 Conversion from hex to decimal Let us convert 8A1D to decimal. Multiply 8x16x16x16. This gives A 1 D Multiply 13 by 1. This gives 13. Multiply 10x16x16. This gives Multiply 1 by 16. This gives 16. Finally add This gives Perform the following conversions: a. Convert to hex. b. Convert to hex. c. Convert 3F7A16 to decimal. d. Convert 5BA16 to binary. Comp Int Basic Computing Concepts 4 Data Representations Page 6

7 Classification of numbers Numbers can be classified as shown in the following tree structure. Unsigned numbers are always positive while signed numbers can be positive or negative. Consider three bits. There are eight different combinations of ones and zeros (these are 000, 001, 010, 011, 100, 101, 110 and 111). These eight combinations can be made to represent the range of numbers from 0 to 7 or the numbers from - 4 to 3. We say that the range from 0 to 7 is unsigned and the range from -4 to 3 is signed. Sign and Magnitude In the Sign and Magnitude representation the leftmost bit is reserved to represent the sign. 1 indicates negative and 0 indicates positive. Let us take an example with 8 bits. sign Now let us consider 4 bits. All the numbers are represented in the following table. Binary Decimal Sign & Magnitude Comp Int Basic Computing Concepts 4 Data Representations Page 7

8 Note that the value zero is repeated twice. The range of values is between -7 and 7. If we had one byte the minimum value would be (-12710) and the maximum would be (12710). Apart from the repeated zero another problem with sign and magnitude representation is that it is not good for computation e.g. making an addition of two numbers etc. Two s Complement Another representation scheme to represent both positive and negative numbers is called two's complement. It is now the nearly universal way of doing this. Integers are represented in a fixed number of bits. Both positive and negative integers can be represented. How to Construct the Negative of an Integer in Two's Complement: Start with an N-bit representation of an integer. To calculate the N-bit representation of the negative integer: 1. Change every 0 to 1 and every 1 to 0). 2. Add one. Suppose we have one byte to represent a number, say -8710, in two s complement. This would be done in the following steps: (1) Write 8710 in binary. This gives (2) Change all ones to zeros and all zeros to ones. This gives (this number is called one s complement) (3) Add gives Therefore = (in two s complement). To express a decimal number is two s complement follow the algorithm: Comp Int Basic Computing Concepts 4 Data Representations Page 8

9 Start with a number N Y Is N negative? N Express mod (N) in binary as usual. Change all zeros to ones and all ones to zeros. Express mod (N) in binary as usual. Add 1. Stop Express the following decimal numbers both in sign-and-magnitude and in two s complement (assume one byte of space): (a) 43 (b) -99 (c) -106 Faster Computation of Two s Complement To work out the two s complement of a number do the following: 1. Start from the right hand side and move to the left hand side by considering all the bits. Comp Int Basic Computing Concepts 4 Data Representations Page 9

10 2. If a bit is equal to zero write a zero, move to the next bit on the left and repeat step 2. If it is equal to one write a 1 and go to step From the next digit on the left to the leftmost digit convert all bits from 0 to 1 and from 1 to 0. Example 1 Express 5710 in two s complement = Example 2 Express in two s complement = = Subtraction using Two s Complement and Addition Suppose we want to calculate 5-3. We follow these steps: 1. 5 is converted to binary. Call this f is converted to binary (two s complement). Call this t. 3. Add f and t but ignore the overflow bit. 4. You have the result. Another example: Perform the following calculations using two s complement arithmetic. All numbers are memorized in one byte. (a) 99 56, (b) , (c) Comp Int Basic Computing Concepts 4 Data Representations Page 10

11 Fractions in Fixed-Point Number Representation Suppose we know that the number is unsigned, what is its conversion in decimal? = 1x x x x x x x x2-4 = = In this representation (i.e. we have 8 bits and the decimal point is fixed after the fourth bit; this is called fixed-point representation): the maximum number is ( ), and the minimum number is What we have seen above is the conversion of a binary number (with a fractional part) into decimal representation. How do we do the opposite? Suppose we want to convert to binary we execute the following steps: 1. Convert the whole part to binary i.e = Convert the decimal part to binary. This is done using the algorithm shown in the diagram below. So = (read the last column from top to bottom) 3. Join the parts i.e (a) Convert the following binary numbers to decimal (i) , (ii) (b) Convert the following decimal numbers to binary (i) , (ii) Maximum and Minimum Values and Ranges The following table shows some maximum and minimum values (on one byte). Comp Int Basic Computing Concepts 4 Data Representations Page 11

12 Minimum Maximum Decimal Binary Decimal Binary Unsigned integer (i.e. whole number) Signed integer (sign and magnitude) Signed integer (two s complement) Unsigned fractional number with fixed point representation (binary point is three positions from the right) Signed fractional number with fixed point representation (binary point is three positions from the right, sign and magnitude) Unsigned fractional number with fixed point representation (binary point is three positions from the right, two s complement) In each of the following questions find the maximum, minimum and the range of the numbers. Assume that the numbers are made up of 6 bits. (a) An unsigned binary integer. (b) Signed integer (sign and magnitude). (c) Signed integer (two s complement). (d) Unsigned fractional number with fixed point representation (binary point is two positions from the right). (e) Signed fractional number with fixed point representation (binary point is two positions from the right, sign and magnitude) (f) Unsigned fractional number with fixed point representation (binary point is two positions from the right, two s complement) 8421 Binary-Coded Decimal Abbreviated as 8421 BCD, binary-coded decimal is a format for representing decimal numbers (integers) in which each digit is represented by four bits (a nibble). For example, the number 375 would be represented as: One advantage of BCD over binary representations is that there is no limit to the size of a number. To add another digit, you just need to add a new 4-bit sequence. In contrast, numbers represented in binary format are generally limited to the largest Comp Int Basic Computing Concepts 4 Data Representations Page 12

13 number that can be represented by 8, 16, 32 or 64 bits. Another virtue of BCD is that it is a more accurate representation (no rounding of decimal quantities). As compared to binary positional systems, BCD's principal drawbacks are a small increase in the complexity of the circuits needed to implement basic arithmetic and a slightly less dense storage. BCD is very common in electronic systems where a numeric value is to be displayed. The BIOS in many personal computers stores the date and time in BCD. (a) Convert the following decimal numbers in 8421 BCD: (i) 3810, (ii) (b) Convert the following BCD number in decimal: ASCII and Unicode Both ASCII and Unicode are codes that convert characters (like n, + etc) and control codes (like backspace and line feed which causes a printer to advance its paper). ASCII is an acronym for the American Standard Code for Information Interchange. ASCII is a code for representing English characters as numbers, with each letter assigned a number from 0 to 127 (using 7 bits). For example, the ASCII code for uppercase M is 77. Most computers use ASCII codes to represent text, which makes it possible to transfer data from one computer to another. Text files stored in ASCII format are sometimes called ASCII files. The standard ASCII character set uses just 7 bits for each character. There are several larger character sets that use 8 bits, which gives them 128 additional characters. The extra characters are used to represent non-english characters (like ö, ū, etc), graphics symbols (like,,, etc), and mathematical symbols (like ⅛,,, etc). The DOS operating system uses a superset of ASCII called extended ASCII or high ASCII. Extended ASCII uses 8 bits to represent a character. Another ASCII derivative is ISO Latin 1. Comp Int Basic Computing Concepts 4 Data Representations Page 13

14 Another set of codes that is used on large IBM computers is EBCDIC (Extended Binary-Coded Decimal Interchange Code). The EBCDIC uses 8-bit representations. Unicode uses 16 bits, which means that it can represent more than 65,000 unique characters. This is necessary so that other languages, such as Greek, Chinese and Japanese can have their symbols represented. Comp Int Basic Computing Concepts 4 Data Representations Page 14

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

### COMPUTER NUMBER CONVERSIONS Binary to Decimal Conversion

COMPUTER NUMBER CONVERSIONS Binary to Decimal Conversion Any binary number can be converted to its decimal equivalent simply by summing together the weights of the various positions in the binary number

### Logic Design. Dr. Yosry A. Azzam

Logic Design Dr. Yosry A. Azzam Binary systems Chapter 1 Agenda Binary Systems : Binary Numbers, Binary Codes, Binary Logic ASCII Code (American Standard Code for Information Interchange) Boolean Algebra

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

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

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

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

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

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

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

### Decimal-to-Binary Conversion. Computer & Microprocessor Architecture HCA103. Repeated Division-by-2 Method. Repeated Multiplication-by-2 Method

Decimal-to-Binary Conversion Computer & Microprocessor Architecture HCA103 Computer Arithmetic Algorithm 1 Step 1: Break the number in two parts: Whole number and fraction part. Step 2: Repeated Division-by-2

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

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

### Number base conversion

Number base conversion The human being use decimal number system while computer uses binary number system. Therefore it is necessary to convert decimal number into its binary equivalent while feeding number

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

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

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

### Chap 3 Data Representation

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

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

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

Data Representation Section 3.1 Data Types Registers contain either data or control information Control information is a bit or group of bits used to specify the sequence of command signals needed for

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

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

### Fixed-point Representation of Numbers

Fixed-point Representation of Numbers Fixed Point Representation of Numbers Sign-and-magnitude representation Two s complement representation Two s complement binary arithmetic Excess code representation

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

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

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

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

### Understanding Binary Numbers. Different Number Systems. Conversion: Bin Hex. Conversion MAP. Binary (0, 1) Hexadecimal 0 9, A(10), B(11),, F(15) :

Understanding Binary Numbers Computers operate on binary values (0 and 1) Easy to represent binary values electrically Voltages and currents. Can be implemented using circuits Create the building blocks

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

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

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

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

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

### 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. In primary school, we would have learned the place values like this: Digit Contributed value = 8000

Number Systems The Decimal (Denary) System A good understanding of other number systems depends on a good understanding of the decimal system that you have used for counting and arithmetic since you started

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

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

### Codes and number systems

Coding Codes and number systems Assume that you want to communicate with your friend with a flashlight in a night, what will you do? Introduction to Computer Yung-Yu Chuang light painting? What s the problem?

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

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

### Binary Representation and Computer Arithmetic

Binary Representation and Computer Arithmetic The decimal system of counting and keeping track of items was first created by Hindu mathematicians in India in A.D. 4. Since it involved the use of fingers

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

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

### Digital Electronics. 1.0 Introduction to Number Systems. Module

Module 1 www.learnabout-electronics.org Digital Electronics 1.0 Introduction to What you ll learn in Module 1 Section 1.0. Recognise different number systems and their uses. Section 1.1 in Electronics.

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

### 1. Number Representation

CSEE 3827: Fundamentals of Computer Systems, Spring 2011 1. Number Representation Prof. Martha Kim (martha@cs.columbia.edu) Web: http://www.cs.columbia.edu/~martha/courses/3827/sp11/ Contents (H&H 1.3-1.4,

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

### CHAPTER 1 BINARY SYSTEM

STUDENT COPY DIGITAL & MICROPROCESSORS 3 CHAPTER 1 BINARY SYSTEM Base Conversion: A number a n, a n 1 a 2, a 1 a 0 a 1 a 2 a 3 expressed in a base r system has coefficient multiplied by powers of r. n

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

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

### 1. Convert the following binary exponential expressions to their 'English'

Answers to Practice Problems Practice Problems - Integer Number System Conversions 1. Convert the decimal integer 427 10 into the following number systems: a. 110101011 2 c. 653 8 b. 120211 3 d. 1AB 16

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

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

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

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

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

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

### ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-378: Digital Logic and Microprocessor Design Winter 2015.

ECE-378: Digital Logic and Microprocessor Design Winter 5 UNSIGNED INTEGER NUMBERS Notes - Unit 4 DECIMAL NUMBER SYSTEM A decimal digit can take values from to 9: Digit-by-digit representation of a positive

### BINARY-CODED DECIMAL (BCD)

BINARY-CODED DECIMAL (BCD) Definition The binary-coded decimal (BCD) is an encoding for decimal numbers in which each digit is represented by its own binary sequence. Basics In computing and electronic

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

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

### 1. True or False? A natural number is the number 0 or any number obtained by adding 1 to a natural number.

CS Illuminated, 5 th ed. Chapter 2 Review Quiz 1. True or False? A natural number is the number 0 or any number obtained by adding 1 to a natural number. 2. True or False? The category of numbers called

### Chapter No.5 DATA REPRESENTATION

Chapter No.5 DATA REPRESENTATION Q.5.01 Complete the following statements. i) Data is a collection of ii) Data becomes information when properly. iii) Octal equivalent of binary number 1100010 is iv) 2

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

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

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

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

### Lecture.5. Number System:

Number System: Lecturer: Dr. Laith Abdullah Mohammed Lecture.5. The number system that we use in day-to-day life is called Decimal Number System. It makes use of 10 fundamental digits i.e. 0, 1, 2, 3,

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

### Switching Circuits & Logic Design

Switching Circuits & Logic Design Jie-Hong Roland Jiang 江介宏 Department of Electrical Engineering National Taiwan University Fall 2013 1 1 Number Systems and Conversion Babylonian number system (3100 B.C.)

### 23 1 The Binary Number System

664 Chapter 23 Binary, Hexadecimal, Octal, and BCD Numbers 23 The Binary Number System Binary Numbers A binary number is a sequence of the digits 0 and, such as 000 The number shown has no fractional part

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

### EEE130 Digital Electronics I Lecture #2

EEE130 Digital Electronics I Lecture #2 -Number Systems, Operations and Codes- By Dr. Shahrel A. Suandi Topics to be discussed 2-1 Decimal Numbers 2-2 Binary Numbers 2-3 Decimal-to-Binary Conversion 2-4

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

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

### The operation of addition can be done by very simple method we will illustrate the operation in a simple way using steps.

Excess 3 Code Under Digital ElectronicsBefore discussing the BCD addition and subtraction using Excess 3 code we have to know what is Excess 3 code. It is a basically a binary code which is made by adding

### Numeral System and Its Importance ROOM: B405

Numeral System and Its Importance HONG@IS.NAIST.JP ROOM: B405 Contents Number System Introduction Number systems used by human Number systems used by computer Number System Conversion Signed Number Representation

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

### Binary, Hexadecimal, Octal, and BCD Numbers

23CH_PHCalter_TMSETE_949118 23/2/2007 1:37 PM Page 1 Binary, Hexadecimal, Octal, and BCD Numbers OBJECTIVES When you have completed this chapter, you should be able to: Convert between binary and decimal

### The Decimal System. Numbering Systems. The Decimal System. The base-n System. Consider value 234, there are: Ver. 1.4

2 The Decimal System Numbering Systems 2010 - Claudio Fornaro Ver. 1.4 Consider value 234, there are: 2 hundreds 3 tens 4 units that is: 2 x 100 + 3 x 10 + 4 x 1 but 100, 10, and 1 are all powers of 10