2 Systems Architecture, Fifth Edition Chapter Goals Describe numbering systems and their use in data representation Compare and contrast various data.

Slides:



Advertisements
Similar presentations
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 2: Data types and addressing modes dr.ir. A.C. Verschueren.
Advertisements

2009 Spring Errors & Source of Errors SpringBIL108E Errors in Computing Several causes for malfunction in computer systems. –Hardware fails –Critical.
The Binary Numbering Systems
Elementary Data Types Prof. Alamdeep Singh. Scalar Data Types Scalar data types represent a single object, i.e. only one value can be derived. In general,
2-1 Chapter 2 - Data Representation Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third Edition.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Introduction.
Chapter 3 Data Representation.
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Chapter 3 Data Representation. Chapter goals Describe numbering systems and their use in data representation Compare and contrast various data representation.
8 November Forms and JavaScript. Types of Inputs Radio Buttons (select one of a list) Checkbox (select as many as wanted) Text inputs (user types text)
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Introduction.
Elementary Data Types Scalar Data Types Numerical Data Types Other
Data types and variables
Chapter 1 Data Storage. 2 Chapter 1: Data Storage 1.1 Bits and Their Storage 1.2 Main Memory 1.3 Mass Storage 1.4 Representing Information as Bit Patterns.
Data Representation Kieran Mathieson. Outline Digital constraints Data types Integer Real Character Boolean Memory address.
Chapter 2 Data Types, Declarations, and Displays
COMP201 Computer Systems Number Representation. Number Representation Introduction Number Systems Integer Representations Examples  Englander Chapter.
Binary Number Systems.
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
Chapter 5 Data representation.
Objectives You should be able to describe: Data Types
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Simple Data Type Representation and conversion of numbers
Computers Organization & Assembly Language
Information Representation (Level ISA3) Floating point numbers.
Computer Organization and Architecture Computer Arithmetic Chapter 9.
Computer Arithmetic. Instruction Formats Layout of bits in an instruction Includes opcode Includes (implicit or explicit) operand(s) Usually more than.
SCSC 311 Information Systems: hardware and software
CSU0014 Assembly Languages Homepage: Textbook: Kip R. Irvine, Assembly Language for Intel-Based Computers,
Summer 2014 Chapter 1: Basic Concepts. Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Chapter Overview Welcome to Assembly Language.
Click to edit Master title style Click to edit Master text styles –Second level Third level –Fourth level »Fifth level 1 Today’s Topics How information.
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
Machine Instruction Characteristics
IT253: Computer Organization
Computers Data Representation Chapter 3, SA. Data Representation and Processing Data and information processors must be able to: Recognize external data.
Data Representation.
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Computer Systems Organization CS 1428 Foundations of Computer Science.
Cis303a_chapt03-2a.ppt Range Overflow Fixed length of bits to hold numeric data Can hold a maximum positive number (unsigned) X X X X X X X X X X X X X.
Data Representation Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
Lecture 5. Topics Sec 1.4 Representing Information as Bit Patterns Representing Text Representing Text Representing Numeric Values Representing Numeric.
Number Systems and Codes. CS2100 Number Systems and Codes 2 NUMBER SYSTEMS & CODES Information Representations Number Systems Base Conversion Negative.
Chapter 19 Number Systems. Irvine, Kip R. Assembly Language for Intel-Based Computers, Translating Languages English: Display the sum of A times.
EEL 3801C EEL 3801 Part I Computing Basics. EEL 3801C Data Representation Digital computers are binary in nature. They operate only on 0’s and 1’s. Everything.
Data Representation, Number Systems and Base Conversions
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
Monday, January 14 Homework #1 is posted on the website Homework #1 is posted on the website Due before class, Jan. 16 Due before class, Jan. 16.
Systems Architecture, Fourth Edition 1 Data Representation Chapter 3.
Chapter Two Hardware Basics: Inside the Box ©1999 Addison Wesley Longman2.2 Chapter Outline What Computers Do A Bit About Bits The Computer’s Core: CPU.
Data Representation. How is data stored on a computer? Registers, main memory, etc. consists of grids of transistors Transistors are in one of two states,
Data Representation Automated data Processing Binary Data representation Mathematical operations Boolean Algebra Hexadecimal Notation.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
CS 125 Lecture 3 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
1 CE 454 Computer Architecture Lecture 4 Ahmed Ezzat The Digital Logic, Ch-3.1.
Chapter 3 Data Representation
Chapter 3 Data Representation
Number Representation
Chapter 6: Data Types Lectures # 10.
Chapter 3 Data Storage.
CS1010 Programming Methodology
Data Structures Mohammed Thajeel To the second year students
Chapter 1 Data Storage.
Introduction to Abstract Data Types
Chapter 3 DataStorage Foundations of Computer Science ã Cengage Learning.
Presentation transcript:

2 Systems Architecture, Fifth Edition Chapter Goals Describe numbering systems and their use in data representation Compare and contrast various data representation methods Describe how nonnumeric data is represented Describe common data structures and their uses

3 Systems Architecture, Fifth Edition Data Representation and Processing Capabilities required of any data/information processor–organic, mechanical, electrical, optical: –Recognizing external data and converting it to an appropriate internal format –Storing and retrieving data internally –Transporting data among internal storage and processing components –Manipulating data to produce desired results or decisions

4 Systems Architecture, Fifth Edition Automated Data Processing Data is converted from native format into a form suitable for the processing device Computers represent data electrically and process it with electrical switches Laws of electricity can be stated as mathematical equations Electronic devices perform computational functions embedded in the equations

5 Systems Architecture, Fifth Edition A + B = C

6 Systems Architecture, Fifth Edition Binary Data Representation Binary number –Only one of two possible values (0 or 1) per digit Reliably transported among computer system components Can be processed by two–state electrical devices (relatively easy to design and fabricate) Correspond directly with values in Boolean logic

7 Systems Architecture, Fifth Edition

8

9

10 Systems Architecture, Fifth Edition Hexadecimal Notation Uses 16 as its base or radix (hex = 6, and decimal = 10) Compact; advantage over binary notation Often used to designate memory addresses

11 Systems Architecture, Fifth Edition

12 Systems Architecture, Fifth Edition Octal Notation Uses base 8 numbering system Has a range of digits from 0 to 7 Expresses large numeric values in: –One-third the length of corresponding binary notation –Double the length of corresponding hexadecimal notation

13 Systems Architecture, Fifth Edition Goals of Computer Data Representation Compactness Accuracy Range Ease of manipulation Standardization

14 Systems Architecture, Fifth Edition Goals of Computer Data Representation (continued) Compactness –Describes number of bits used to represent a numeric value –More compact data representation format; less expense to implement in computer hardware Accuracy –Precision of representation increases with number of data bits used

15 Systems Architecture, Fifth Edition Goals of Computer Data Representation (continued) Ease of manipulation –Machine efficiency when executing processor instructions (addition, subtraction, equality comparison) –Processor efficiency depends on its complexity Standardization –Ensures correct and efficient data transmission –Provides flexibility to combine hardware from different vendors with minimal data communication problems

16 Systems Architecture, Fifth Edition CPU Data Types Primitive data types –Integer –Real number –Character –Boolean –Memory address Representation format for each type balances compactness, accuracy, ease of manipulation, and standardization

17 Systems Architecture, Fifth Edition Integers A whole number—a value that does not have a fractional part Data formats can be signed or unsigned –Determines largest and smallest values that can be represented Excess notation Two’s complement notation (most common) Range and overflow

18 Systems Architecture, Fifth Edition Excess Notation Can be used to represent signed integers Divides a range of ordinary binary numbers in half; uses lower half for negative values and upper half for nonnegative values Always uses a fixed number of bits with the leftmost bit representing the sign (1 for nonnegative and 0 for negative values)

19 Systems Architecture, Fifth Edition

20 Systems Architecture, Fifth Edition Two’s Complement Notation Nonnegative integer values are represented as ordinary binary values Compatible with digital electronic circuitry –Leftmost bit represents the sign –Fixed number of bit positions –Only two logic circuits required to perform addition on single-bit values –Subtraction can be performed as addition of a negative value

21 Systems Architecture, Fifth Edition Range and Overflow Overflow –Occurs when absolute value of a computational result contains too many bits to fit into fixed-width data format Avoiding overflow –Double precision data formats –Careful programming

22 Systems Architecture, Fifth Edition Range and Overflow Choose data format width by balancing: –Numeric range –Chance of overflow during program execution –Complexity, cost, and speed of processing and storage devices

23 Systems Architecture, Fifth Edition Real Numbers Contain both whole and fractional components Require separation of components to be represented within computer circuitry –Fixed radix point (simple) –Floating point notation (complex)

24 Systems Architecture, Fifth Edition

25 Systems Architecture, Fifth Edition Floating Point Notation Similar to scientific notation, except that 2 is the base value = mantissa x 2 exponent Trades numeric range for accuracy –Value can have many digits of precision for large or small magnitudes, but not both simultaneously Less accurate and more difficult to process than two’s complement format

26 Systems Architecture, Fifth Edition

27 Systems Architecture, Fifth Edition

28 Systems Architecture, Fifth Edition Range, Overflow, and Underflow Range –Limited by number of bits in a floating point string and formats of mantissa and exponent fields Overflow –Can occur within the exponent Underflow –Occurs when absolute value of a negative exponent is too large to fit within allocated bits

29 Systems Architecture, Fifth Edition Precision and Truncation Precision –Accuracy is reduced as the number of digits available to store mantissa is reduced Truncation –Stores numeric value in the mantissa until available bits are consumed; discards remaining bits –Causes an error or approximation which can magnify –Programmers avoid by using integer types

30 Systems Architecture, Fifth Edition Processing Complexity Floating point formats –Optimized for processing efficiency –Require complex processing circuitry (translates to difference in speed) Programmers never use real numbers when an integer will suffice (speed and accuracy)

31 Systems Architecture, Fifth Edition Character Data Represented indirectly by defining a table that assigns numeric values to individual characters Characteristics of coding methods –All users must share same coding/decoding method –Coded values must be capable of being stored or transmitted –Specific method represents a tradeoff among compactness, ease of manipulation, accuracy, range, and standardization

32 Systems Architecture, Fifth Edition Common Coding Methods EBCDIC (Extended Binary Coded Decimal Interchange Code) ASCII (American Standard Code for Information Interchange) –Subset of Unicode –Device control –Software and hardware support

33 Systems Architecture, Fifth Edition

34 Systems Architecture, Fifth Edition (Partial listing)

35 Systems Architecture, Fifth Edition ASCII Limitations Insufficient range –Uses 7-bit code, providing 128 table entries (33 for device control) –95 printable characters can be represented English-based

36 Systems Architecture, Fifth Edition Unicode Assigns nonnegative integers to represent individual printable characters (like ASCII) Larger coding table than ASCII –Uses 16-bit code providing 65,536 table entries Can represent written text from all modern languages Widely supported in modern software

37 Systems Architecture, Fifth Edition Boolean Data Has only two data values—true and false Potentially most concise coding format; only a single bit is required

38 Systems Architecture, Fifth Edition Memory Addresses Identifying numbers of memory bytes in primary storage Simple or complex numeric values depending on memory model used by CPU –Flat memory addresses (single integer) –Segmented memory addresses (multiple integers) Require definition of specific coding format

39 Systems Architecture, Fifth Edition Data Structures Related groups of primitive data elements organized for a type of common processing Defined and manipulated within software Commonly used data structures: arrays, linked lists, records, tables, files, indices, and objects Many use pointers to link primitive data components

40 Systems Architecture, Fifth Edition

41 Systems Architecture, Fifth Edition Pointers and Addresses Pointer –Data element that contains the address of another data element Address –Location of a data element within a storage device

42 Systems Architecture, Fifth Edition Arrays and Lists List –A set of related data values Array –An ordered list in which each element can be referenced by an index to its position

43 Systems Architecture, Fifth Edition

44 Systems Architecture, Fifth Edition Linked Lists Data structures that use pointers so list elements can be scattered among nonsequential storage locations –Singly linked lists –Doubly linked lists Easier to expand or shrink than an array

45 Systems Architecture, Fifth Edition

46 Systems Architecture, Fifth Edition

47 Systems Architecture, Fifth Edition

48 Systems Architecture, Fifth Edition

49 Systems Architecture, Fifth Edition Records and Files Records –Data structures composed of other data structures or primitive data elements –Used as a unit of input and output to files Files –Sequence of records on secondary storage

50 Systems Architecture, Fifth Edition

51 Systems Architecture, Fifth Edition Methods of Organizing Files Sequential –Stores records in contiguous storage locations Indexed –An array of pointers to records –Efficient record insertion, deletion, and retrieval

52 Systems Architecture, Fifth Edition

53 Systems Architecture, Fifth Edition Classes and Objects Classes –Data structures that contain traditional data elements and programs that manipulate that data –Combine related data items and extend the record to include methods that manipulate the data items Objects –One instance, or variable, of the class

54 Systems Architecture, Fifth Edition

55 Systems Architecture, Fifth Edition Summary How data is represented and stored within computer hardware How simple data types are used as building blocks to create more complex data structures (e.g., arrays, records) Understanding data representation is key to understanding hardware and software technology