Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computers Data Representation Chapter 3, SA. Data Representation and Processing Data and information processors must be able to: Recognize external data.

Similar presentations


Presentation on theme: "Computers Data Representation Chapter 3, SA. Data Representation and Processing Data and information processors must be able to: Recognize external data."— Presentation transcript:

1 Computers Data Representation Chapter 3, SA

2 Data Representation and Processing Data and information processors must be able to: Recognize external data and convert it to an appropriate internal format Store and retrieve data internally Transport data among internal storage and processing components

3 Binary Representation of Data Computers represent data using binary numbers. Binary numbers correspond directly with values in boolean logic. Computers combine multiple digits to form a single data value to represent large numbers.

4 Basic data types Integers – whole numbers Real numbers – w/ fractional components Exponential representation Character ASCII vs EBCDIC Boolean –true/false BLOB (Binary Large Object)

5 Data structures Defined in software Arrays Lists Records Tables Files Indices Objects

6 Data Structures A data structure is a related group of primitive data elements that is organized for some type of processing. Data structures are defined and manipulated within software.

7 Data Structures Virtually all data structures make extensive use of pointers and addresses. Pointer – a data element that contains the address of another data element. Address – the location of some data element within a storage device.

8 Arrays and Linked Lists Linked List: A linked list is a data structure that uses pointers so list elements can be scattered among nonsequential storage locations.

9 Records and Files A record is a data structure composed of other data structures or primitive data elements. Records are used as a unit of input and output to files or databases.

10 File Organization Physical arrangement of the records of a file on secondary storage devices Sequential Linked List Indexed Hashed

11 Sequential File Sequential file sorted in alphabetical order. Sequential files are usually sorted in ID sequence order to facilitate batch processing.

12 Sequential File Processing Transaction Old Master New Master Process Sequential files must be recopied from the point of any insertion or deletion to the end of the file. They are commonly used in batch processing where a new master file will be generated each time the file is updated.

13 Linked List Linked list to sort data alphabetically within department. An external reference must point to the start record (05).

14 Linked List File Processing The next record in a linked list is found at the address stored in the record. Records are added at any location in the DASD and pointers adjusted to include them. Deletions are not erased, but pointers changed to omit the deleted record.

15 Indexed File (sequential index) Index to access data by department abbreviation.

16 Indexed File Processing Index Data File When a record is inserted or deleted in a file the data can be added at any location in the data file. Each index must also be updated to reflect the change. For a simple sequential index this may mean rewriting the index for each insertion. Index

17 Segmented Index Index Data Leaf Root Nodes

18 Indexed File Processing (segmented index) Data File Index Data can be inserted or deleted at any location in the data file. The index(es) must be updated for each change, but only the affected segments need to be rewritten.

19 Hashing (Prime Number Remainder Algorithm) zPick a prime number to define the file space zDivide the key by the prime number zPut the result in the location of the remainder Key = 41 13 3 41 39 2 Location = 2

20 Hashed File Processing Key Calculation addrContents

21 Records and Files A sequence of records on secondary storage is called a file. A sequence of records stored within main memory is called a table. Sequential files suffer the same problems as contiguous arrays when inserting and deleting records. To eliminate this problem, linked lists and indexed files are used.

22 Classes and Objects


Download ppt "Computers Data Representation Chapter 3, SA. Data Representation and Processing Data and information processors must be able to: Recognize external data."

Similar presentations


Ads by Google