Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 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 X X X 16384 4096 1024 256 128 64 32 16 8 4 2 1 32768 8192 2048 512 32768 16384 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1 ------------ 65535 10 16 Bits Chapter 3

2 Cis303a_chapt03-2a.ppt Range Overflow X X X X X X X X X X X X X X X X 16384 4096 1024 256 128 64 32 16 8 4 2 1 32768 8192 2048 512 16384 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1 ------------ +/- 32767 10 Fixed length of bits to hold numeric data Can hold a maximum positive and negative number (signed) 16 Bits Sign bit – not used to hold numeric data

3 Cis303a_chapt03-2a.ppt Range Overflow Numeric range of an unsigned integer (no sign bit – all bits used for numeric data) 2 n-1 n-1 = number of bits X X X X X X X X X X X X X X X X 16384 4096 1024 256 128 64 32 16 8 4 2 1 32768 8192 2048 512 2 16-1 = 2 15 (16 bits – 0 through 15) 2 15 2 14 2 13 2 12 2 11 2 10 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 32768 16384 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1 ------------ 65535 10

4 Cis303a_chapt03-2a.ppt Real Numbers Contains Whole number and fraction Fraction to the right of the radix point (decimal position) 10010 2 / 100 2 = 100.1 2 100 100100 1001 0 01 0 100 000 Radix (decimal point) = 100.1 2

5 Cis303a_chapt03-2a.ppt X X X X X X X X X X X X X X X X 16384 4096 1024 256 128 64 32 16 8 4 2 1 32768 8192 2048 512 Real Numbers Contains Whole number and fraction Fraction to the right of the radix point (decimal position) 1 0 0. 1 S X X X X X X X X X X X X X X X X. X X X X X X X X X X X X X X X (Page 67) 2 -1 = ½ =.5 2 -2 = ¼ =.25 2 -3 = 1/8 =.125 2 -4 = 1/16 =.0625 4.5 10

6 Cis303a_chapt03-2a.ppt Floating Point Contains Whole number and fraction Radix is movable to accommodate extremely large positive or negative numbers Radix is not fixed Negative exponent – radix moves to the left the exponent amount 2 -5 xxxxxxxxx. Positive exponent – radix moves to the right the exponent amount 2 5 x.xxxxxxxx Sign Exponent Mantissa SEEEEEEEMMMMMMMMM (Page 77-79)

7 Cis303a_chapt03-2a.ppt Character Data Alphabetic letters Numerals Punctuation Special Purpose ($,%,&,# ETC.) String: a grouping of character data (Page 81) Early Computers Binary Coded Decimal (BCD) 6 bits (Octal) Limited character range Limited memory Slow processors

8 Cis303a_chapt03-2a.ppt Character Data Modern computers Extended Binary Coded Decimal Interchange Code (EBCDIC) 8 bits (Hexadecimal) Mainframes American Standard Code for Information Interchange (ASCII) Data hardware communications Printers, displays (monitors) 8 bit format Parity checking – one bit Data – 7 bits Data communications Displayable characters (A-Z, 0-9 etc.) Device control characters Page eject Load/unload CD (Table Page 83)

9 Cis303a_chapt03-2a.ppt Device Control (Page 84) Serial Transmission: Book: Transmission of one character at a time over a single wire Transmission of one or more bytes of data transmitted one bit after another Data is placed in a buffer in the receiving device Data is acted upon (control character or information data) when the buffer is filled or an Escape character is received (Table 3-6 page 85) Parallel Transmission: Transmission of one or more bytes of data transmitted at the same time along multiple wires Data is placed in a buffer in the receiving device Data is acted upon (control character or information data) when the buffer is filled or an Escape character is received

10 Cis303a_chapt03-2a.ppt Unicode (Page 87) An attempt to commonize data formation Includes the ASCII character set 16 bit – allows up to 65,536 separate characters/commands International Standards Organization (ISO) Can handle many languages other than English Boolean Data Contains on one of two possible states True False Used with programmatic logic (IF statements) Decision statements Pack data Store boolean results (single bits) into bytes (Page 88)

11 Cis303a_chapt03-2a.ppt Memory Addresses (Page 89) Contiguous bytes of storage Each byte is addressable (accessible) Non negative address numbers An attempt to commonize data formation Flat Memory Model Beginning byte is 0 and continues sequentially until the last byte of memory Segmented Memory Model Memory divided into sections (pages) Each page has separate address Each byte in a page has an address 9Includes the ASCII character set 16 bit – allows up to 65,536 separate characters/commands International Standards Organization (ISO) Can handle many languages other than English

12 Cis303a_chapt03-2a.ppt Memory Addresses Flat Memory Model Beginning byte is 0 and continues sequentially until the last byte of memory 0 1 2 3 4 5 6 7 10 11 12 13 Address Register

13 Cis303a_chapt03-2a.ppt Memory Addresses 0 1 2 3 4 5 6 7 10 11 12 13 Address Register Segmented Memory Model Memory divided into sections (pages) Each page has separate address Each byte in a page has an address 9Includes the ASCII character set Segment

14 Cis303a_chapt03-2a.ppt Data Structures Primitive Data types Data types of the CPU Binary strings of bits Programming Data types Character Numeric Data Structure A related group of primitive data elements that is organized for some type of common processing (page 91) Groups of Primitive Data Types assembled by the programmer into usable data strings (alpha or numeric) Character strings, numbers, arrays, records, files System software provides application services to manipulate commonly used Data Structures (i.e. drivers, interfaces) (page 92)

15 Cis303a_chapt03-2a.ppt Pointers A data element that contains the address (points to) another data element (data or and address) Disk read/writes Blocks (i.e. 512k block) Address ‘points’ to the beginning of the block The driver knows how much data to gather for the read/write (Page 93) Arrays and Lists List: unordered set of related data Array: an ordered set of related data Each element can be referenced specifically for it’s contents (Page 93)

16 Cis303a_chapt03-2a.ppt Arrays and Lists List: unordered set of related data Array: an ordered set of related data Each element can be referenced specifically for it’s contents 1.00 8.00 10.00 4.00 5.00 2.00 9.00 3.00 6.00 7.00 List (unordered) 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 Array (ordered) Purchase a 5 hamburgers: got to 5 th element in the array

17 Cis303a_chapt03-2a.ppt Linked Lists A data structure that uses pointers Element may be scattered – do not have to be contiguous 1.00 6.00 3.00 9.00 5.00 4.0010.00 8.00 7.00 2.00 (Page 95)

18 Cis303a_chapt03-2a.ppt Linked Lists Insert a new element 1.00 6.00 3.00 9.00 5.00 4.0010.00 8.00 7.00 2.00 (Page 96) 4.50

19 Cis303a_chapt03-2a.ppt Doubly Linked Lists Each element points to the next element as well as the preceding element 1.00 6.00 3.00 9.00 5.00 4.0010.00 8.00 7.00 2.00 (Page 97)

20 Cis303a_chapt03-2a.ppt Files Groups of related records Are accessed via a driver for the specific hardware device Are varied in type: sequential, random, indexed Records One element in a file that contains the required information All data is contained in fields (unique positions) pertinent to the data type and information (Page 98) Database ‘Records’ are called Tables Not directly accessible via programming Accesses data through the database engine

21 Cis303a_chapt03-2a.ppt Object Oriented Programming Is a programming methodology not a language CLASS: data structure that contains both the data and the programming code to manipulate the data METHOD: the programming code to manipulate the data OBJECT: an instance of the CLASS (Page 99) CLASS: Customer OBJECT Instance Customer 1 Methods OBJECT Instance Customer 2 Methods OBJECT Instance Customer 3 Methods


Download ppt "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."

Similar presentations


Ads by Google