Computer Architecture I: Digital Design Dr. Robert D. Kent Lecture 1 – Part B Data, Representation & Numeracy.

Slides:



Advertisements
Similar presentations
The Binary Numbering Systems
Advertisements

Lecture - 2 Number systems and computer data formats
Binary Systems1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
COE 202: Digital Logic Design Signed Numbers
A digital system is a system that manipulates discrete elements of information represented internally in binary form. Digital computers –general purposes.
Chapter 1 Binary Systems 1-1. Digital Systems
Signed Numbers.
ECE 331 – Digital System Design
VIT UNIVERSITY1 ECE 103 DIGITAL LOGIC DESIGN CHAPTER I NUMBER SYSTEMS AND CODES Reference: M. Morris Mano & Michael D. Ciletti, "Digital Design", Fourth.
Mantıksal Tasarım – BBM231 M. Önder Efe
Number Systems Lecture 02.
Binary Number Systems.
Data Representation in Computers. Data Representation in Computers/Session 3 / 2 of 33 Number systems  The additive approach – Number earlier consisted.
Dr. Bernard Chen Ph.D. University of Central Arkansas
The Binary Number System
Data Representation Number Systems.
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
Simple Data Type Representation and conversion of numbers
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
Numbering systems.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
Logic and Digital System Design - CS 303
#1 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
Data Representation Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
مدار منطقي مظفر بگ محمدي Course Structure & Grading Homework: 25% Midterm: 30% Final:50% There is 5% extra! ( =105!) Textbook:
Number systems & Binary codes MODULE 1 Digital Logic Design Ch1-2 Outline of Chapter 1  1.1 Digital Systems  1.2 Binary Numbers  1.3 Number-base Conversions.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
IT101: INFORMATION TECHNOLOGY FUNDAMENTALS 1 Edited By Dr. Ahmed Abo-Bakr Information Technology Dept. Faculty of Computers & Information.
Digital Logic Lecture 2 Number Systems
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
1 Data Representation Characters, Integers and Real Numbers Binary Number System Octal Number System Hexadecimal Number System Powered by DeSiaMore.
AEEE2031 Data Representation and Numbering Systems.
CDP ECE Spring 2000 ECE 291 Spring 2000 Lecture 2: Number Systems & x86 Instructions Constantine D. Polychronopoulos Professor, ECE Office: 463.
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
Number Systems Denary Base 10 Binary Base 2 Hexadecimal Base 16
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Chapter 1: Binary Systems
CPEN Digital Logic Design Binary Systems Spring 2004 C. Gerousis © Digital Design 3 rd Ed., Mano Prentice Hall.
1 Digital Logic Design Lecture 2 More Number Systems/Complements.
ECE DIGITAL LOGIC LECTURE 3: DIGITAL COMPUTER AND NUMBER SYSTEMS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/19/2016.
BINARY SYSTEMS ENGR. KASHIF SHAHZAD 1. BINARY NUMBERS 1/2 Internally, information in digital systems is of binary form groups of bits (i.e. binary numbers)
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Digital logic COMP214  Lecture 2 Dr. Sarah M.Eljack Chapter 1 1.
Dr. ClincyLecture 2 Slide 1 CS Chapter 2 (1 of 5) Dr. Clincy Professor of CS Note: Do not study chapter 2’s appendix (the topics will be covered.
CPE 201 Digital Design Lecture 2: Digital Systems & Binary Numbers (2)
CS2100 Computer Organisation
Data Representation COE 308 Computer Architecture
Data Representation.
Number Systems and Binary Arithmetic
Integer Real Numbers Character Boolean Memory Address CPU Data Types
CHAPTER 1 : INTRODUCTION
Chapter 3 Data Representation
Number Systems.
University of Gujrat Department of Computer Science
Data Structures Mohammed Thajeel To the second year students
BEE1244 Digital System and Electronics BEE1244 Digital System and Electronic Chapter 2 Number Systems.
Data Representation in Computer Systems
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
CS 101 – Sept. 4 Number representation Integer Unsigned √ Signed √
Number Systems.
Data Representation COE 308 Computer Architecture
Presentation transcript:

Computer Architecture I: Digital Design Dr. Robert D. Kent Lecture 1 – Part B Data, Representation & Numeracy

In order to understand how data is processed by computers it is necessary to understand –what is data –how is data represented in computers –how is data manipulated and processed

Bits, Bytes, Words... The basic units of data are organized as follows –bit this is the fundamental unit of data 2-state switch values: 0/1 (e.g. true/false; off/on) –byte a group of 8 bits taken as a single unit the smallest unit of memory that is addressable –word the size of the (data) bus, all bits simultaneously transferred Pentium I, II, III32 bits (4 bytes) Pentium IV64 bits (8 bytes) –other units are used, such as blocks, strings, and so on these are considered non-standard application structures

Size terminology The following prefix terms are used to denote timing interval size (seconds): –10 -3 milli –10 -6 micro –10 -9 nano – pico – femto The following prefix terms are used to denote storage device size (bytes): –2 10 kilo (1024) –2 20 mega ( ~ 10 6 ) –2 30 giga ( ~ 10 9 ) –2 40 tera ( ~ ) –2 50 peta ( ~ )

Binary Coding Binary, or base-2, coding is used for all data in the computer 2-state switches –only 0 and 1 are used as values –each corresponds to a specific electrical (magnetic/optical) signal value Characters –the ASCII system is used to represent printable characters and also some non-printable signals used in inter-computer communication across networks Numbers –unsigned integer –signed integer –real, or floating point, numbers –decimal (base-10) numbers are also used in computers

Positional Representation (1) In the decimal system (base-10) we may represent a general, positive number N in the form: N = d L-1 d L-2 … d 2 d 1 d 0. f 1 f 2 … f M where each d or f represents a single decimal digit, 0 to 9. This can be rewritten in the form: L-1 M N = Sum d k * 10 k + Sum f k * 10 -k k=0 k=1 This representation permits us to perform the basic arithmetic operations using conventional techniques taught at an early age.

Positional Representation (2) In a system based on a different multiplier, or radix (we say, “base-R”) we may represent a general, positive number N in the form: N = d L-1 d L-2 … d 2 d 1 d 0. f 1 f 2 … f M where each d or f represents a single digit, but now the concept and representation of digit takes on a new meaning. This can be rewritten in the form: L-1 M N = Sum d k * R k + Sum f k * R -k ; 0 ≤ d k, f k < R k=0 k=1 This representation still permits us to perform the basic arithmetic operations as we did for decimal arithmetic!

Unsigned Binary Non-negative integers (greater or equal to zero) –Range from 0 (smallest) to 2 L -1 (largest) for an L-bit representation We can construct an unsigned binary sequence using the algorithm –Build up starting from 0. –Add 1 to the previous number. –Repeat previous step until a string of 1’s of length L is reached. Binary Dec

Signed Binary - 1’s complement In most cases we require both positive and negative integers One idea for “designing” negative numbers uses complementation –change 0’s to 1’s and 1’s to 0’s

Signed Binary - 1’s complement In most cases we require both positive and negative integers One idea for “designing” negative numbers uses complementation –change 0’s to 1’s and 1’s to 0’s Values range from -2 L-1 +1 (most negative) to 2 L-1 -1 (largest, most positive) for an L-bit representation. Permits two different representations of zero! Binary Dec.Binary Dec

Signed Binary - 2’s complement We need a more efficient representation of positive and negative integers using an L-bit form. One straightforward approach is to consider the operation: X + Y 0 What representation of Y gives a zero sum? bbbbbbb Y

Signed Binary - 2’s complement We need a more efficient representation of positive and negative integers using an L-bit form. One straightforward approach is to consider the operation: X + Y 0 What representation of Y gives a zero sum? Carry 3 -3 Carry out

Signed Binary - 2’s complement We need a more efficient representation of positive and negative integers using an L-bit form. The 2’s complement scheme is based on the algorithm: –1. Find the 1’s complement –2. Add 1 to the result to find the 2’s complement form ~

(r-1)’s and r’s complements In an arbitrary radix of fixed (finite) representation length L, there are two related complements that are important. (r-1) ’s complement form. –Given the number N in radix-r form, the (r-1)’s complement is defined as r L – 1 – N –Consider r = 10, L = 4 and N = Clearly, r 4 = 10000, thus r 4 – 1 = Thus, Easy! –Note that the sum of N and the (r-1)’s complement of N is always a string of (r- 1)’s (9 in this example). r ’s complement form –The r’s complement is found from the (r-1)’s complement by just adding 1. –Note that this guarantees that the sum of N and its r’s complement is just zero (0) to within the size L of the representation!

Subtraction of unsigned Numbers Problem: Find (M – N) where both M and N are unsigned numbers in base-r, size L digits. Recall that we first learned to do this subtraction using the concept of “borrowing” – computers can be designed to do this, but there is a simpler way using r’s complements and addition Example: M > N, L=5 ( M = 72532, N = 13250) Borrowing: ’s Compl.: Discard Carry Final Answer: 59282

Subtraction of unsigned Numbers Example: M < N, L=5 ( M = 13250, N = 72532) Borrowing: ’s Compl.: ????? Find 10’s compl., add minus Final Answer:

Converting between arbitrary bases Consider the problem of converting the number into its equivalent number in base-13. Although this may seem strange at first, it is solved by repeatedly dividing 153 (and successive quotients) by 13 and collecting remainders, hence: 13 into (A) 0 11 (B) ANSWER: BA Problem: What is the radix of the integer numbers (coefficients) below if the solution to the quadratic equation shown is x=5? x 2 – 12 x + 39 = 0 Substituting x = 5 and expanding the positional representations of each coefficient: 5 2 – ( 1*R + 2 ) * 5 + ( 3*R + 9 ) = 25 – 5*R – *R + 9 = 24 – 2*R = 0 It follows from the last step that R = 12. WARNING: Converting to arbitary bases may be quite difficult. If terms up to R 4 arise (a quartic equation) it can be solved exactly, but not for higher powers. Such problems require brute force.

Floating Point Representations of real numbers, both positive and negative. The range required is often quite large. –Use scientific notation Examples: x x sign fraction exponent 0 + (pos.) (pos. or neg.) 1 -

Floating Point Use scientific notation to represent the –sign –fraction (mantissa) –exponent sign exponent fraction 0 + (2’s compl.) 1 - When the leftmost (ie. most significant) fraction bit is one (1) the fraction is called normalized; otherwise it is unnormalized. Note that the exponent may be positive or negative. We use the 2’s complement form. The exponent is then called the characteristic.

Binary Coded Decimal (BCD) Many computers contain logic to process decimal representations directly. The standard representation is based on an ASCII-compatible scheme for each separate decimal digit. This is called the BCD scheme. Note that a minimum of 4 bits is required to represent all 10 decimal digits

Binary Conversions - Octal, Hexadecimal It is important to understand how to convert values from one to another representation. Some conversions are straightforward, while others require more effort. Example: Binary to Octal (base-8) Octal Digits: Binary:

Binary Conversions - Octal, Hexadecimal It is important to understand how to convert values from one to another representation. Some conversions are straightforward, while others require more effort. Example: Binary to Octal (base-8) Octal Digits: Binary: (Groups of 3 digits, right to left) For fractions, group bits left to right from the radix point

Binary Conversions - Octal, Hexadecimal It is important to understand how to convert values from one to another representation. Some conversions are straightforward, while others require more effort. Example: Binary to Octal (base-8) Octal Digits: Binary: Convert each group to an octal digit. Octal:

Binary Conversions - Octal, Hexadecimal It is important to understand how to convert values from one to another representation. Some conversions are straightforward, while others require more effort. Example: Binary to Hexadecimal (base-16) Hexadecimal Digits: A B C D E F Binary: Hexadecimal: 2 C 6 B Convert each group of 4 bits to a hexadecimal digit.

Binary/Decimal Conversions Converting to and from binary to decimal requires some more effort. Examples: Decimal integer to Binary Repeatedly divide quotient by 2 until zero is reached. Record the remainder for each division:

Binary/Decimal Conversions Converting binary to/from decimal requires some more effort. Examples: Binary integer to Decimal Use the positional representation of the binary string, multiplying each successive power of 2 by the value of the binary digit: => 1 x x x x 2 0

Binary/Decimal Conversions Converting to and from binary to decimal requires some more effort. Examples: Decimal fraction (0.12) to Binary Repeatedly multiply by 2, each time “stripping” the integer digit (0 or 1) and leaving the remaining fractional product residue x (most significant) 0.24 x x x x x x x x ….. Collect bits: If a repeating sequence develops, then stop after preset number of digits

Arithmetic Operations All of the basic arithmetic operators are typically represented in modern computer ALU’s These are developed just as in base-10 by virtue of the positional representation properties Examples: –Addition –Subtraction –Multiplication –Division

Circuit Design for Computers The relevance of the preceding discussion is directed towards the design of digital circuits for computers Internal circuits are used for –memory storage units –CPU storage units –ALU operations –CU operations We will now proceed to lay the foundation for digital circuit design and analysis by studying the Boolean Algebra and the Boolean Calculus.

Summary We have considered the nature and representation of data –bits, bytes, words –binary codings –numbers positional representation unsigned binary signed binary (2’s complement) floating point decimal –conversion from one to another representation –arithmetic operations