Computer Number Systems Supplement

Size: px
Start display at page:

Download "Computer Number Systems Supplement"

Transcription

1 Computer Number Systems Supplement Dr. Ken Hoganson, All Rights Reserved. SUPPLEMENT CONTENTS S.1 Decimal System: Powers-of-the-Base 2 S.2 Converting to Binary: Division/Remainder Algorithm. 3 S.3 Binary Addition. 4 S.4 Bits, Bytes, and Words. 5 S.5 Hexadecimal Number System.. 6 S.6 Negative Numbers 8

2 Computer Number Systems, Dr. Ken Hoganson, 2 S.1 Decimal System: Powers-of-the-Base The decimal number system is based on powers of the base 10. The place value of each digit is a power of ten. We are so comfortable with this system, that we don t even think about the underlying mechanism. For instance, the number 1259 uses digits in place values that are based on powers of the base (base 10): the 9 is in the 10 0 the 5 is in the 10 1 the 2 is in the 10 2 the 1 is in the 10 3 column - 1s column column - 10s column column - 100s column column s column 1259 is 9 X 1 = X 10 = X 100 = X 1000 = The computer s hardware logic is implemented with transistors, which can work like switches, turning electricity on or off. If we consider on to be a 1, and off to be 0, then internal computer logic can be represented using the Binary number system. The Binary number system uses the same mechanism as the decimal system outlined above, but the base is different - base 2 (binary) rather than base 10 (decimal). The place values for binary are based on powers of the base 2: So, the binary number can be converted to decimal so we can understand it, by using the powers-of-the-base mechanism: = 1 X 1 = 1 1 X 2 = 2 0 X 4 = 0 0 X 8 = 0 1 X 16 = 16 1 X 32 = 32 0 X 64 = 0 1 X 128 = 128 v SUM = 179 in decimal

3 Computer Number Systems, Dr. Ken Hoganson, 3 S.2 Division/Remainder Algorithm: Converting to Binary Section C.1 explained how the decimal system works, and how the binary system uses the same mechanism. In the process, a way to convert a binary number to a decimal number was discovered, by using the powers-of-the-base system. To convert in the other direction, from decimal to binary, requires a different method called the division/remainder method. The idea is to repeatedly divide the decimal number to be converted, by the base to be converted into (base 2). The remainders that result are the binary digits. Example: convert 155 to binary: Start from the bottom and work up. Stop 2)1 Q = 0, R = 1 2)2 Q = 1, R = 0 2)4 Q = 2, R = 0 2)9 Q = 4, R = 1 2)19 Q = 9, R = 1 2)38 Q = 19, R = 0 2)77 Q = 38, R = 1 Start: 2 )155 Q = 77, R = 1 Answer is Be careful to read the digits in the correct order. Check the answer with the powers-of-the-base system: 1 X 1 = 1 1 X 2 = 2 1 X 8 = 8 1 X 16 = 16 1 X 128 =

4 Computer Number Systems, Dr. Ken Hoganson, 4 S.3: Addition in Binary Just as in decimal, binary numbers can be added together. Because the base is different, the carry over to the next column is different. In decimal, when a column adds up to more than 9, a carry is added to the column to the left (the next higher place value). Since the base is 2 in binary with digits of 0 and 1, when a sum evaluates to more than 1, a carry must be added to the column to the left. Examples:

5 Computer Number Systems, Dr. Ken Hoganson, 5 S.4: Bits, Bytes, and Words Bits are organized into groups inside the computer system. The most common grouping is to place eight bits in a byte. A byte just looks like a string of eight zeros and ones: The range of possible binary values that a byte can hold is from to There are 256 possible combinations of zeros and ones arranged in any order in a byte. The number of possible combinations is based on a power of the base: 2 #of bits = the number of combinations Examples: Number of bits Number of combinations = 2 combinations (0 and 1) = 4 combinations, (00, 01, 10, 11) = = 1024 A byte can hold a small number, or a single character. Characters are all the letters of the alphabet in upper and lower case, punctuation symbols, the digits 0-9, and can include other special symbols. Bytes can be grouped together to form words. A word is simply one or more bytes, but is has a meaning in terms of the computer s power. A computer with a word size of a single byte, can work with and manipulate data eight bits at a time (a rough approximation). A sixteen-bit computer (word size of two bytes) is more powerful, because it can access and manipulate 16 bits at a time rather than 8. Typical word sizes for our common personal computers are 32-bit (4 bytes) and 64-bit (8 bytes). Computer systems include large quantities of bytes billions and trillions or bytes are becoming common. In dealing with these large numbers, a shorthand way to refer to large numbers of bytes has developed. Shorthand Term Roughly Power of 2 Actual K Kilobyte Thousand M or Meg Megabyte Million ,048,576 G or Gig Gigabtye Billion ,073,741,824 T Terabyte Trillion ,099,511,627,776

6 Computer Number Systems, Dr. Ken Hoganson, 6 S.5: Hexadecimal Number System Another number system used in computing is the hexadecimal system. Hexadecimal is base-16 number system, that is, just as decimal has a base of 10 (10 digits, 0-9), and binary is base 2 (2 digits, 0-1), hexadecimal is base-16 (16 digits, 0-15). But representing the values from is problematic a single numeral is needed to represent those values. The first six letters of the alphabet are used for those integers: A B C D E F Note that just as decimal includes digits for 0-9, and the 10 is two digits, with the 1 in the tens column, hexadecimal includes digits for 0-15, and sixteen is represented with a 1 in the sixteen s column. In hexadecimal, 10 is worth sixteen in decimal. The same place value mechanism used in decimal and binary applies to hexadecimal as well, place values are based on powers of the base, in this case, base sixteen. For example, 1B52 in hexadecimal can be converted to our more familiar decimal system: the 2 is in the 16 0 column - 1s column the 5 is in the 16 1 column - 16s column the B (11) is in the 16 2 column - 256s column the 1 is in the 16 3 column s column 1B52 16 is 2 X 1 = X 16 = X 256 = X 4096 = Subscripts are often used to indicate the base of the number, which is not always apparent just from looking at the digits. Hexadecimal turns out to be a useful number system for working with binary digital computers because of the relationship between base-16 and base-2. Sixteen is a convenient power of the base-2: 2 4 = 16. So four binary (base-2) digits that span values from (15) cover the same set of value as one hexadecimal digit (0-15). Thus, a group of four bits can be conveniently represented with a single hexadecimal digit as follows:

7 Computer Number Systems, Dr. Ken Hoganson, 7 Base-2, Binary Base-16, Hexadecimal A 1011 B 1100 C 1101 D 1110 E 1111 F So if a group of four binary digits can be represented with a single hexadecimal digit, then an 8- bit byte can be represented with two hexadecimal digits: Binary Hexadecimal CB F7 Note that it is far more convenient to talk about digital binary values in hexadecimal than it is in binary. For instance, a sixteen bit binary value: can be easily shared or recorded as C925. Converting from binary to hexadecimal (hex), and hex to binary is easily down without a formal conversion process, simply by grouping bits into groups of four bits, and translating that binary value to its equivalent hex digit. At first the student may need to use decimal as an intermediary: D F Converting multi-digit values: Binary Hex , ,1 B1 Hex Binary A8 10, F 3,

8 Computer Number Systems, Dr. Ken Hoganson, 8 Section S.6: Negative Numbers So far we have worked with unsigned binary values, but number systems need to be able to represent both positive and negative numbers. For the purposes of this discussion, we will limit ourselves to values with 8 binary bits. In eight bits, a range of values can be represented. There are 256 possible combinations of 0s and 1s with eight bits, ranging from up to An examination of the range of values follows: Binary Hex Decimal FC FD FE FF 255 There are 256 possible combinations allowing values from 0 to 255. The number of combinations is also based on Powers-of-the-Base: 2 8 = 256. To represent negative numbers (in eight bits) some of the available values must be dedicated to represent negative numbers, and some to positive value.

9 Computer Number Systems, Dr. Ken Hoganson, 9 Sign-Magnitude The most obvious way to represent negative numbers is to use one of the digits to represent a sign bit, which indicates whether the number is to be positive or negative. The convention is to use the left-most bit for the sign bit, with zero meaning a positive number and 1 meaning a negative number. The available combinations of 0s and 1s now have a different meaning: Binary Hex Decimal S E F negative zero? FC FD FE FF -127 Two problems with sign-magnitude representation are apparent from the above table of values: 1. There are two representations for zero, both a positive zero and a negative zero. Not only is this incorrect, but the two representations for zero waste a combination that could otherwise be used to represent some other value. 2. Another problem with sign-magnitude representation is revealed only when attempting basic mathematics. For instance adding a positive and negative number should work correctly: = -12! The problem with working with positive and negative numbers can be fixed for sign-magnitude. Addition circuits can be designed to work correctly for adding numbers of each combination of signs of values: Four different addition circuits can be designed inside the CPU to handle each case, but this requires four times the circuitry and transistors to implement, clearly not efficient. And special cases need to be created for the other operations, not just addition. And each case must also correctly recognize the two representations for zero.

10 Computer Number Systems, Dr. Ken Hoganson, 10 Two s Complement A better approach is a method called Two s-complement. It is more complicated and nonintuitive, and only the unsolvable problems of the sign-magnitude representation drive the use of two s-complement. But two s-complement does indeed work correctly and avoids the need for separate circuits to implement math with combinations of positive and negative numbers. In Two s Complement, A single bit is used to represent the sign of the number, and the left-most bit is still used for the sign. But the meaning of the combinations of bits is different than signmagnitude for the negative numbers. The negative numbers count down from -128 in the progression of bit combinations: Binary Hex Decimal S E F FC FD FE FF -1 It is now difficult to read a negative number, as the meaning of the bits are reversed (complemented). Note that there is now only one representation for zero, and the extra combination allows an extra value to be represented: So the combinations with the zero as the sign bit range from 0 up to 127, and the combinations with the one as the sign bit range from down to -1. Fortunately, there is a simple way to translate or understand the meanings of the negative values, and its how this representation got its name. To convert a positive value to its negative representation in two s complement, a two-step process is used: Start with the binary positive representation: Complement (reverse) all the bits (one s complement) Add one.

11 Computer Number Systems, Dr. Ken Hoganson, 11 Example: find the two s complement representation of -3: A positive 3 in 8-bits is: Complementing the bits: Add one = -3 This is the same value for negative 3 shown in the previous table of values. The same two s-complement steps can also be used to translate or convert a negative value: A negative 3 in 8-bits is: Complementing the bits: Add one = +3 So a negative two s complement value can be read by finding its positive value equivalent for the magnitude of the number, and remembering that it s the negative of that value. Two s-complement and Math: Two s-complement does indeed solve the problem with working with combinations of signs: = = = +2! Notice that the carry from the addition of ones to the next place value carrys over beyond the eight bits, and inside the computer, this result is noted but the bit is discarded [Somewhat amusingly described as thrown into the bit bucket, though there is no actual bit-bucket inside the machine]. Another example: = = = -12!

12 Computer Number Systems, Dr. Ken Hoganson, 12 Supplement Exercises: Work out the following problems on paper (show your work). Convert from binary to decimal: Work the following problems, converting decimal to binary (show all work) Work the following programs, representing the following decimal numbers in two s complement binary in eight bits

Module 1: Information Representation I -- Number Systems

Module 1: Information Representation I -- Number Systems Unit 1: Computer Systems, pages 1 of 7 - Department of Computer and Mathematical Sciences CS 1305 Intro to Computer Technology 1 Module 1: Information Representation I -- Number Systems Objectives: Learn

More information

CS & IT Conversions. Magnitude 10,000 1,

CS & IT Conversions. Magnitude 10,000 1, CS & IT Conversions There are several number systems that you will use when working with computers. These include decimal, binary, octal, and hexadecimal. Knowing how to convert between these number systems

More information

Thus needs to be a consistent method of representing negative numbers in binary computer arithmetic operations.

Thus needs to be a consistent method of representing negative numbers in binary computer arithmetic operations. 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

More information

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Dec Hex Bin ORG ; ZERO. Introduction To Computing Dec Hex Bin 0 0 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

More information

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

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

More information

Number representations

Number representations Number representations Number bases Three number bases are of interest: Binary, Octal and Hexadecimal. We look briefly at conversions among them and between each of them and decimal. Binary Base-two, or

More information

Number Systems. Decimal numbers. Binary numbers. Chapter 1 <1> 8's column. 1000's column. 2's column. 4's column

Number Systems. Decimal numbers. Binary numbers. Chapter 1 <1> 8's column. 1000's column. 2's column. 4's column 1's column 10's column 100's column 1000's column 1's column 2's column 4's column 8's column Number Systems Decimal numbers 5374 10 = Binary numbers 1101 2 = Chapter 1 1's column 10's column 100's

More information

Number Systems Using and Converting Between Decimal, Binary, Octal and Hexadecimal Number Systems

Number Systems Using and Converting Between Decimal, Binary, Octal and Hexadecimal Number Systems Number Systems Using and Converting Between Decimal, Binary, Octal and Hexadecimal Number Systems In everyday life, we humans most often count using decimal or base-10 numbers. In computer science, it

More information

Memory Addressing, Binary, and Hexadecimal Review

Memory Addressing, Binary, and Hexadecimal Review C++ By A EXAMPLE Memory Addressing, Binary, and Hexadecimal Review You do not have to understand the concepts in this appendix to become well-versed in C++. You can master C++, however, only if you spend

More information

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

The type of all data used in a C++ program must be specified The type of all data used in a C++ program must be specified A data type is a description of the data being represented That is, a set of possible values and a set of operations on those values There are

More information

Numbers and Representations

Numbers and Representations Çetin Kaya Koç http://koclab.cs.ucsb.edu/teaching/cs192 koc@cs.ucsb.edu Çetin Kaya Koç http://koclab.cs.ucsb.edu Fall 2016 1 / 38 Outline Computational Thinking Representations of integers Binary and decimal

More information

CHW 261: Logic Design

CHW 261: Logic Design CHW 261: Logic Design Instructors: Prof. Hala Zayed Dr. Ahmed Shalaby http://www.bu.edu.eg/staff/halazayed14 http://bu.edu.eg/staff/ahmedshalaby14# Slide 1 Slide 2 Slide 3 Digital Fundamentals CHAPTER

More information

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

Using sticks to count was a great idea for its time. And using symbols instead of real sticks was much better. 2- Numbering Systems Tutorial 2-1 What is it? There are many ways to represent the same numeric value. Long ago, humans used sticks to count, and later learned how to draw pictures of sticks in the ground

More information

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

Number Systems. Dr. Tarek A. Tutunji Philadelphia University, Jordan Number Systems Dr. Tarek A. Tutunji Philadelphia University, Jordan Number Systems Programmable controllers use binary numbers in one form or another to represent various codes and quantities. Every number

More information

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

Lecture (01) Digital Systems and Binary Numbers By: Dr. Ahmed ElShafee ١ Lecture (01) Digital Systems and Binary Numbers By: Dr. Ahmed ElShafee Digital systems Digital systems are used in communication, business transactions, traffic control, spacecraft guidance, medical

More information

Chapter 2: Number Systems

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

More information

Numeral Systems. -Numeral System -Positional systems -Decimal -Binary -Octal. Subjects:

Numeral Systems. -Numeral System -Positional systems -Decimal -Binary -Octal. Subjects: Numeral Systems -Numeral System -Positional systems -Decimal -Binary -Octal Subjects: Introduction A numeral system (or system of numeration) is a writing system for expressing numbers, that is a mathematical

More information

Computer Organization

Computer Organization Computer Organization Register Transfer Logic Number System Department of Computer Science Missouri University of Science & Technology hurson@mst.edu 1 Decimal Numbers: Base 10 Digits: 0, 1, 2, 3, 4, 5,

More information

CC411: Introduction To Microprocessors

CC411: Introduction To Microprocessors CC411: Introduction To Microprocessors OBJECTIVES this chapter enables the student to: Use number { base 2, base 10, or base 16 }. Add and subtract binary/hex numbers. Represent any binary number in 2

More information

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

Lecture (01) Introduction Number Systems and Conversion (1) Lecture (01) Introduction Number Systems and Conversion (1) By: Dr. Ahmed ElShafee ١ Digital systems Digital systems are used in communication, business transactions, traffic control, spacecraft guidance,

More information

Digital Systems and Binary Numbers

Digital Systems and Binary Numbers Digital Systems and Binary Numbers Mano & Ciletti Chapter 1 By Suleyman TOSUN Ankara University Outline Digital Systems Binary Numbers Number-Base Conversions Octal and Hexadecimal Numbers Complements

More information

A complement number system is used to represent positive and negative integers. A complement number system is based on a fixed length representation

A complement number system is used to represent positive and negative integers. A complement number system is based on a fixed length representation Complement Number Systems A complement number system is used to represent positive and negative integers A complement number system is based on a fixed length representation of numbers Pretend that integers

More information

Signed umbers. Sign/Magnitude otation

Signed umbers. Sign/Magnitude otation Signed umbers So far we have discussed unsigned number representations. In particular, we have looked at the binary number system and shorthand methods in representing binary codes. With m binary digits,

More information

Objectives. Connecting with Computer Science 2

Objectives. Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn how numbering systems are used to count Understand the significance of positional value

More information

The x86 Microprocessors. Introduction. The 80x86 Microprocessors. 1.1 Assembly Language

The x86 Microprocessors. Introduction. The 80x86 Microprocessors. 1.1 Assembly Language The x86 Microprocessors Introduction 1.1 Assembly Language Numbering and Coding Systems Human beings use the decimal system (base 10) Decimal digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Computer systems use the

More information

Digital Fundamentals

Digital Fundamentals Digital Fundamentals Tenth Edition Floyd Chapter 2 2009 Pearson Education, Upper 2008 Pearson Saddle River, Education NJ 07458. All Rights Reserved Decimal Numbers The position of each digit in a weighted

More information

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR UNIT I Digital Systems: Binary Numbers, Octal, Hexa Decimal and other base numbers, Number base conversions, complements, signed binary numbers, Floating point number representation, binary codes, error

More information

Review of Data Representation & Binary Operations Dhananjai M. Rao CSA Department Miami University

Review of Data Representation & Binary Operations Dhananjai M. Rao CSA Department Miami University Review of Data Representation & Binary Operations Dhananjai M. Rao () CSA Department Miami University 1. Introduction In digital computers all data including numbers, characters, and strings are ultimately

More information

Binary, Hexadecimal and Octal number system

Binary, Hexadecimal and Octal number system Binary, Hexadecimal and Octal number system Binary, hexadecimal, and octal refer to different number systems. The one that we typically use is called decimal. These number systems refer to the number of

More information

Digital Systems and Binary Numbers

Digital Systems and Binary Numbers Digital Systems and Binary Numbers Prof. Wangrok Oh Dept. of Information Communications Eng. Chungnam National University Prof. Wangrok Oh(CNU) 1 / 51 Overview 1 Course Summary 2 Binary Numbers 3 Number-Base

More information

1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM

1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM 1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM 1.1 Introduction Given that digital logic and memory devices are based on two electrical states (on and off), it is natural to use a number

More information

Objective 1.02 Understand Numbering Systems

Objective 1.02 Understand Numbering Systems Objective.0 Understand Numbering Systems C O M P U T E R P R O G R A M M I N G I Number Systems Number systems we will talk about: Decimal (Base 0 ) Binary (Base ) Hexadecimal (Base 6 ) Decimal The number

More information

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

Moodle WILLINGDON COLLEGE SANGLI. ELECTRONICS (B. Sc.-I) Introduction to Number System Moodle 1 WILLINGDON COLLEGE SANGLI ELECTRONICS (B. Sc.-I) Introduction to Number System E L E C T R O N I C S Introduction to Number System and Codes Moodle developed By Dr. S. R. Kumbhar Department of

More information

Number Systems MA1S1. Tristan McLoughlin. November 27, 2013

Number Systems MA1S1. Tristan McLoughlin. November 27, 2013 Number Systems MA1S1 Tristan McLoughlin November 27, 2013 http://en.wikipedia.org/wiki/binary numeral system http://accu.org/index.php/articles/1558 http://www.binaryconvert.com http://en.wikipedia.org/wiki/ascii

More information

Lecture (02) Operations on numbering systems

Lecture (02) Operations on numbering systems Lecture (02) Operations on numbering systems By: Dr. Ahmed ElShafee ١ Dr. Ahmed ElShafee, ACU : Spring 2018, CSE202 Logic Design I Complements of a number Complements are used in digital computers to simplify

More information

T02 Tutorial Slides for Week 2

T02 Tutorial Slides for Week 2 T02 Tutorial Slides for Week 2 ENEL 353: Digital Circuits Fall 2017 Term Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary 19 September, 2017

More information

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

Slide Set 1. for ENEL 339 Fall 2014 Lecture Section 02. Steve Norman, PhD, PEng Slide Set 1 for ENEL 339 Fall 2014 Lecture Section 02 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary Fall Term, 2014 ENEL 353 F14 Section

More information

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

Excerpt from: Stephen H. Unger, The Essence of Logic Circuits, Second Ed., Wiley, 1997 Excerpt from: Stephen H. Unger, The Essence of Logic Circuits, Second Ed., Wiley, 1997 APPENDIX A.1 Number systems and codes Since ten-fingered humans are addicted to the decimal system, and since computers

More information

Appendix. Numbering Systems. In This Appendix...

Appendix. Numbering Systems. In This Appendix... Numbering Systems ppendix In This ppendix... Introduction... inary Numbering System... exadecimal Numbering System... Octal Numbering System... inary oded ecimal () Numbering System... 5 Real (Floating

More information

CHAPTER 2 Number Systems

CHAPTER 2 Number Systems CHAPTER 2 Number Systems Objectives After studying this chapter, the student should be able to: Understand the concept of number systems. Distinguish between non-positional and positional number systems.

More information

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

BINARY SYSTEM. Binary system is used in digital systems because it is: CHAPTER 2 CHAPTER CONTENTS 2.1 Binary System 2.2 Binary Arithmetic Operation 2.3 Signed & Unsigned Numbers 2.4 Arithmetic Operations of Signed Numbers 2.5 Hexadecimal Number System 2.6 Octal Number System

More information

Number System. Introduction. Decimal Numbers

Number System. Introduction. Decimal Numbers 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

More information

NUMBER SYSTEMS AND CODES

NUMBER SYSTEMS AND CODES C H A P T E R 69 Learning Objectives Number Systems The Decimal Number System Binary Number System Binary to Decimal Conversion Binary Fractions Double-Dadd Method Decimal to Binary Conversion Shifting

More information

Appendix. Numbering Systems. In this Appendix

Appendix. Numbering Systems. In this Appendix Numbering Systems ppendix n this ppendix ntroduction... inary Numbering System... exadecimal Numbering System... Octal Numbering System... inary oded ecimal () Numbering System... 5 Real (Floating Point)

More information

2 Number Systems 2.1. Foundations of Computer Science Cengage Learning

2 Number Systems 2.1. Foundations of Computer Science Cengage Learning 2 Number Systems 2.1 Foundations of Computer Science Cengage Learning 2.2 Objectives After studying this chapter, the student should be able to: Understand the concept of number systems. Distinguish between

More information

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. Numbers & Number Systems

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. Numbers & Number Systems SCHOOL OF ENGINEERING & BUILT ENVIRONMENT Mathematics Numbers & Number Systems Introduction Numbers and Their Properties Multiples and Factors The Division Algorithm Prime and Composite Numbers Prime Factors

More information

Number Systems. Both numbers are positive

Number Systems. Both numbers are positive Number Systems Range of Numbers and Overflow When arithmetic operation such as Addition, Subtraction, Multiplication and Division are performed on numbers the results generated may exceed the range of

More information

NUMERIC SYSTEMS USED IN NETWORKING

NUMERIC SYSTEMS USED IN NETWORKING NUMERIC SYSTEMS USED IN NETWORKING Decimal - Binary - Hexadecimal Table ASCII Code 128 64 32 16 8 4 2 1 The Letter A 0 1 0 0 0 0 0 1 Data Units Base 10 Numbering System Base 2 Numbering System Decimal

More information

Binary Codes. Dr. Mudathir A. Fagiri

Binary Codes. Dr. Mudathir A. Fagiri Binary Codes Dr. Mudathir A. Fagiri Binary System The following are some of the technical terms used in binary system: Bit: It is the smallest unit of information used in a computer system. It can either

More information

Chapter 1 Review of Number Systems

Chapter 1 Review of Number Systems 1.1 Introduction Chapter 1 Review of Number Systems Before the inception of digital computers, the only number system that was in common use is the decimal number system which has a total of 10 digits

More information

1.3 Systems of numeration: To represent quantities in the different systems of numeration, specific symbols are used, which are also called ciphers.

1.3 Systems of numeration: To represent quantities in the different systems of numeration, specific symbols are used, which are also called ciphers. Chapter One 1.1 Introduction: Numbers are used to express quantities. There are many numerations systems used in the field of digital electronics, one of the most important being the binary system of numeration

More information

THE LOGIC OF COMPOUND STATEMENTS

THE LOGIC OF COMPOUND STATEMENTS CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS Copyright Cengage Learning. All rights reserved. SECTION 2.5 Application: Number Systems and Circuits for Addition Copyright Cengage Learning. All rights reserved.

More information

Chapter 2 Exercises and Answers

Chapter 2 Exercises and Answers Chapter 2 Exercises and nswers nswers are in blue. For Exercises -5, match the following numbers with their definition.. Number. Natural number C. Integer number D. Negative number E. Rational number unit

More information

Level ISA3: Information Representation

Level ISA3: Information Representation Level ISA3: Information Representation 1 Information as electrical current At the lowest level, each storage unit in a computer s memory is equipped to contain either a high or low voltage signal Each

More information

Real Numbers finite subset real numbers floating point numbers Scientific Notation fixed point numbers

Real Numbers finite subset real numbers floating point numbers Scientific Notation fixed point numbers Real Numbers We have been studying integer arithmetic up to this point. We have discovered that a standard computer can represent a finite subset of the infinite set of integers. The range is determined

More information

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

Ms Sandhya Rani Dash UNIT 2: NUMBER SYSTEM AND CODES. 1.1 Introduction Ms Sandhya Rani Dash UNIT 2: NUMBER SYSTEM AND CODES Structure 2.1 Introduction 2.2 Objectives 2.3 Binary Numbers 2.3.1 Binary-to-Decimal conversion 2.3.2 Decimal-to-Binary Conversion 2.4 Octal Numbers

More information

Bits, Words, and Integers

Bits, Words, and Integers Computer Science 52 Bits, Words, and Integers Spring Semester, 2017 In this document, we look at how bits are organized into meaningful data. In particular, we will see the details of how integers are

More information

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

The type of all data used in a C (or C++) program must be specified The type of all data used in a C (or C++) program must be specified A data type is a description of the data being represented That is, a set of possible values and a set of operations on those values

More information

Discussion. Why do we use Base 10?

Discussion. Why do we use Base 10? MEASURING DATA Data (the plural of datum) are anything in a form suitable for use with a computer. Whatever a computer receives as an input is data. Data are raw facts without any clear meaning. Computers

More information

Data Representation 1

Data Representation 1 1 Data Representation Outline Binary Numbers Adding Binary Numbers Negative Integers Other Operations with Binary Numbers Floating Point Numbers Character Representation Image Representation Sound Representation

More information

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

Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Number Representation Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur 1 Number Representation 2 1 Topics to be Discussed How are numeric data items actually

More information

Topic Notes: Bits and Bytes and Numbers

Topic Notes: Bits and Bytes and Numbers Computer Science 220 Assembly Language & Comp Architecture Siena College Fall 2010 Topic Notes: Bits and Bytes and Numbers Binary Basics At least some of this will be review, but we will go over it for

More information

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

Digital Fundamentals. CHAPTER 2 Number Systems, Operations, and Codes Digital Fundamentals CHAPTER 2 Number Systems, Operations, and Codes Decimal Numbers The decimal number system has ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 The decimal numbering system has a base of

More information

Mastering Binary Math

Mastering Binary Math Cisco certification candidates, from the CCNA to the CCIE, must master binary math. This includes basic conversions, such as binary-to-decimal and decimal-to-binary, as well as more advanced scenarios

More information

Slide Set 1. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

Slide Set 1. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary Slide Set 1 for ENEL 353 Fall 2017 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary Fall Term, 2017 SN s ENEL 353 Fall 2017 Slide Set 1 slide

More information

DIGITAL SYSTEM DESIGN

DIGITAL SYSTEM DESIGN DIGITAL SYSTEM DESIGN UNIT I: Introduction to Number Systems and Boolean Algebra Digital and Analog Basic Concepts, Some history of Digital Systems-Introduction to number systems, Binary numbers, Number

More information

Octal and Hexadecimal Integers

Octal and Hexadecimal Integers Octal and Hexadecimal Integers CS 350: Computer Organization & Assembler Language Programming A. Why? Octal and hexadecimal numbers are useful for abbreviating long bitstrings. Some operations on octal

More information

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

More information

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

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 CS 64 Lecture 2 Data Representation Reading: FLD 1.2-1.4 Decimal Numbers: Base 10 Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Example: 3271 = (3x10 3 ) + (2x10 2 ) + (7x10 1 ) + (1x10 0 ) 1010 10?= 1010 2?= 1

More information

data within a computer system are stored in one of 2 physical states (hence the use of binary digits)

data within a computer system are stored in one of 2 physical states (hence the use of binary digits) Binary Digits (bits) data within a computer system are stored in one of 2 physical states (hence the use of binary digits) 0V and 5V charge / NO charge on a transistor gate ferrite core magnetised clockwise

More information

Teaching KS3 Computing. Session 3 Theory: More on binary and representing text Practical: Introducing IF

Teaching KS3 Computing. Session 3 Theory: More on binary and representing text Practical: Introducing IF Teaching KS3 Computing Session 3 Theory: More on binary and representing text Practical: Introducing IF Today s session 5:00 6:00 Representing text as numbers characters and the computer 6.00 7.00 Programming

More information

Final Labs and Tutors

Final Labs and Tutors ICT106 Fundamentals of Computer Systems - Topic 2 REPRESENTATION AND STORAGE OF INFORMATION Reading: Linux Assembly Programming Language, Ch 2.4-2.9 and 3.6-3.8 Final Labs and Tutors Venue and time South

More information

CHAPTER 2 (b) : AND CODES

CHAPTER 2 (b) : AND CODES DKT 122 / 3 DIGITAL SYSTEMS 1 CHAPTER 2 (b) : NUMBER SYSTEMS OPERATION AND CODES m.rizal@unimap.edu.my sitizarina@unimap.edu.my DECIMAL VALUE OF SIGNED NUMBERS SIGN-MAGNITUDE: Decimal values of +ve & -ve

More information

REPRESENTING INFORMATION:

REPRESENTING INFORMATION: REPRESENTING INFORMATION: BINARY, HEX, ASCII CORRESPONDING READING: WELL, NONE IN YOUR TEXT. SO LISTEN CAREFULLY IN LECTURE (BECAUSE IT WILL BE ON THE EXAM(S))! CMSC 150: Fall 2015 Controlling Information

More information

Data Representation. DRAM uses a single capacitor to store and a transistor to select. SRAM typically uses 6 transistors.

Data Representation. DRAM uses a single capacitor to store and a transistor to select. SRAM typically uses 6 transistors. Data Representation Data Representation Goal: Store numbers, characters, sets, database records in the computer. What we got: Circuit that stores 2 voltages, one for logic ( volts) and one for logic (3.3

More information

Computer Sc. & IT. Digital Logic. Computer Sciencee & Information Technology. 20 Rank under AIR 100. Postal Correspondence

Computer Sc. & IT. Digital Logic. Computer Sciencee & Information Technology. 20 Rank under AIR 100. Postal Correspondence GATE Postal Correspondence Computer Sc. & IT 1 Digital Logic Computer Sciencee & Information Technology (CS) 20 Rank under AIR 100 Postal Correspondence Examination Oriented Theory, Practice Set Key concepts,

More information

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

= 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

More information

Positional notation Ch Conversions between Decimal and Binary. /continued. Binary to Decimal

Positional notation Ch Conversions between Decimal and Binary. /continued. Binary to Decimal Positional notation Ch.. /continued Conversions between Decimal and Binary Binary to Decimal - use the definition of a number in a positional number system with base - evaluate the definition formula using

More information

BSC & BIT Numbering Systems. ITU Lecture 3b

BSC & BIT Numbering Systems. ITU Lecture 3b BSC & BIT -1 2017-18 Numbering Systems ITU 07102 Lecture 3b Introduction We use a number to present a quantity (value) of any thing that can be quantified. Quantities are measured, monitored, recorded,

More information

Conversion Between Number Bases

Conversion Between Number Bases Conversion Between Number Bases MATH 100 Survey of Mathematical Ideas J. Robert Buchanan Department of Mathematics Summer 2018 General Number Bases Bases other than 10 are sometimes used in numeration

More information

CMPE223/CMSE222 Digital Logic Design. Positional representation

CMPE223/CMSE222 Digital Logic Design. Positional representation CMPE223/CMSE222 Digital Logic Design Number Representation and Arithmetic Circuits: Number Representation and Unsigned Addition Positional representation First consider integers Begin with positive only

More information

The. Binary. Number System

The. Binary. Number System The Binary Number System Why is Binary important? Everything on a computer (or other digital device) is represented by Binary Numbers One to Five in various systems 1 2 3 4 5 I II III IV V 1 10 11 100

More information

What Is It? Instruction Register Address Register Data Register

What Is It? Instruction Register Address Register Data Register What Is It? Consider the following set of 32 binary digits, written in blocks of four so that the example is not impossible to read. 0010 0110 0100 1100 1101 1001 1011 1111 How do we interpret this sequence

More information

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

Chapter 3: Number Systems and Codes. Textbook: Petruzella, Frank D., Programmable Logic Controllers. McGraw Hill Companies Inc. Chapter 3: Number Systems and Codes Textbook: Petruzella, Frank D., Programmable Logic Controllers. McGraw Hill Companies Inc., 5 th edition Decimal System The radix or base of a number system determines

More information

MC1601 Computer Organization

MC1601 Computer Organization MC1601 Computer Organization Unit 1 : Digital Fundamentals Lesson1 : Number Systems and Conversions (KSB) (MCA) (2009-12/ODD) (2009-10/1 A&B) Coverage - Lesson1 Shows how various data types found in digital

More information

Real Numbers finite subset real numbers floating point numbers Scientific Notation fixed point numbers

Real Numbers finite subset real numbers floating point numbers Scientific Notation fixed point numbers Real Numbers We have been studying integer arithmetic up to this point. We have discovered that a standard computer can represent a finite subset of the infinite set of integers. The range is determined

More information

Number Systems. Readings: , Problem: Implement simple pocket calculator Need: Display, adders & subtractors, inputs

Number Systems. Readings: , Problem: Implement simple pocket calculator Need: Display, adders & subtractors, inputs Number Systems Readings: 3-3.3.3, 3.3.5 Problem: Implement simple pocket calculator Need: Display, adders & subtractors, inputs Display: Seven segment displays Inputs: Switches Missing: Way to implement

More information

Topic Notes: Bits and Bytes and Numbers

Topic Notes: Bits and Bytes and Numbers Computer Science 220 Assembly Language & Comp Architecture Siena College Fall 2011 Topic Notes: Bits and Bytes and Numbers Binary Basics At least some of this will be review for most of you, but we start

More information

World Inside a Computer is Binary

World Inside a Computer is Binary C Programming 1 Representation of int data World Inside a Computer is Binary C Programming 2 Decimal Number System Basic symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Radix-10 positional number system. The radix

More information

Number systems and binary

Number systems and binary CS101 Fundamentals of Computer and Information Sciences LIU 1 of 8 Number systems and binary Here are some informal notes on number systems and binary numbers. See also sections 3.1 3.2 of the textbook.

More information

Chapter 2. Data Representation in Computer Systems

Chapter 2. Data Representation in Computer Systems Chapter 2 Data Representation in Computer Systems Chapter 2 Objectives Understand the fundamentals of numerical data representation and manipulation in digital computers. Master the skill of converting

More information

umber Systems bit nibble byte word binary decimal

umber Systems bit nibble byte word binary decimal umber Systems 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, or as a state in a transistor. To perform useful operations on these

More information

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

Computer Architecture and System Software Lecture 02: Overview of Computer Systems & Start of Chapter 2 Computer Architecture and System Software Lecture 02: Overview of Computer Systems & Start of Chapter 2 Instructor: Rob Bergen Applied Computer Science University of Winnipeg Announcements Website is up

More information

DRAM uses a single capacitor to store and a transistor to select. SRAM typically uses 6 transistors.

DRAM uses a single capacitor to store and a transistor to select. SRAM typically uses 6 transistors. Data Representation Data Representation Goal: Store numbers, characters, sets, database records in the computer. What we got: Circuit that stores 2 voltages, one for logic 0 (0 volts) and one for logic

More information

1.1. INTRODUCTION 1.2. NUMBER SYSTEMS

1.1. INTRODUCTION 1.2. NUMBER SYSTEMS Chapter 1. 1.1. INTRODUCTION Digital computers have brought about the information age that we live in today. Computers are important tools because they can locate and process enormous amounts of information

More information

Variables and Data Representation

Variables and Data Representation You will recall that a computer program is a set of instructions that tell a computer how to transform a given set of input into a specific output. Any program, procedural, event driven or object oriented

More information

Digital Logic Lecture 2 Number Systems

Digital Logic Lecture 2 Number Systems Digital Logic Lecture 2 Number Systems By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department Outline Introduction. Basic definitions. Number systems types. Conversion between different

More information

LOGIC DESIGN. Dr. Mahmoud Abo_elfetouh

LOGIC DESIGN. Dr. Mahmoud Abo_elfetouh LOGIC DESIGN Dr. Mahmoud Abo_elfetouh Course objectives This course provides you with a basic understanding of what digital devices are, how they operate, and how they can be designed to perform useful

More information

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

DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) COURSE / CODE NUMBER SYSTEM COURSE / CODE DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) NUMBER SYSTEM A considerable subset of digital systems deals with arithmetic operations. To understand the

More information

Logic, Words, and Integers

Logic, Words, and Integers Computer Science 52 Logic, Words, and Integers 1 Words and Data The basic unit of information in a computer is the bit; it is simply a quantity that takes one of two values, 0 or 1. A sequence of k bits

More information