CIS 212 Microcomputer Architecture Day 6 Rhys Eric

  • Slides: 27
Download presentation
CIS 212 Microcomputer Architecture Day 6 Rhys Eric Rosholt Office: Office Phone: Web Site:

CIS 212 Microcomputer Architecture Day 6 Rhys Eric Rosholt Office: Office Phone: Web Site: Email Address: Gillet Hall - Room 304 718 -960 -8663 http: //comet. lehman. cuny. edu/rosholt/ rhys. rosholt @ lehman. cuny. edu

Chapter 3 Data Representation

Chapter 3 Data Representation

Chapter 3 Data Representation Chapter Outline Data Representation and Processing Automated Data Processing Binary

Chapter 3 Data Representation Chapter Outline Data Representation and Processing Automated Data Processing Binary Data Representation Goals of Computer Data Representation CPU Data Types – Integer – Real number – Character – Boolean – Memory address Technology Focus: Intel Memory Address Format Data Structures

CPU Data Types • Primitive data types – – – Integer Real number Character

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

Memory Addresses • Identifying numbers of memory bytes in primary storage • Simple or

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 • requires definition of specific coding format

Intel Memory Address Formats • 8088 – 20 -bit memory addresses • 4 -bit

Intel Memory Address Formats • 8088 – 20 -bit memory addresses • 4 -bit segment identifier • 16 -bit segment offset • 80286 – 24 -bit memory addresses • 8 -bit segment identifier • 16 -bit segment offset • 80386 – 32 -bit memory addresses • 16 -bit segment identifier • 16 -bit segment offset • 80486 • Pentium

Data Structures • Related groups of primitive data elements organized for a type of

Data Structures • Related groups of primitive data elements organized for a type of common processing • Defined and manipulated within software • Many use pointers to link primitive data components

Commonly Used Data Structures arrays linked lists records tables files indices objects

Commonly Used Data Structures arrays linked lists records tables files indices objects

One Address Finds Many Data Elements

One Address Finds Many Data Elements

Pointers and Addresses • Pointer – Data element that contains the address of another

Pointers and Addresses • Pointer – Data element that contains the address of another data element • Address – Location of a data element within a storage device

Arrays and Lists • List – A set of related data values • Array

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

A simple array is used to store words

A simple array is used to store words

Linked Lists • Data structures that use pointers so list elements can be scattered

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

A Singly Linked List

A Singly Linked List

A Singly Linked List

A Singly Linked List

Editing An Array

Editing An Array

Editing A Singly Linked List

Editing A Singly Linked List

A Doubly Linked List

A Doubly Linked List

Records and Files • Records – Data structures composed of other data structures or

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

A Record Data Structure

A Record Data Structure

Methods of Organizing Files • Sequential – Stores records in contiguous storage locations •

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

An Indexed File

An Indexed File

Classes and Objects • Classes – Data structures that contain traditional data elements and

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

A Class of Objects

A Class of Objects

Summary • How data is represented and stored within computer hardware • How simple

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

Chapter Goals • Describe numbering systems and their use in data representation • Compare

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

Next Class Tuesday February 21, 2012 Rhys Eric Rosholt Office: Office Phone: Web Site:

Next Class Tuesday February 21, 2012 Rhys Eric Rosholt Office: Office Phone: Web Site: Email Address: Gillet Hall - Room 304 718 -960 -8663 http: //comet. lehman. cuny. edu/rosholt/ rhys. rosholt @ lehman. cuny. edu