MoreDataRepresentation - More Data Representation More Data...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
More Data Representation Beta Draft - Do not distribute © 2001, By Randall Hyde Page 87 More Data Representation Chapter Four 4.1 Chapter Overview Although the basic machine data objects (bytes, w ords, and double w ords) appear to represent nothing more than signed or unsigned numeric v alues, we can emplo y these data types to represent man y other types of objects. This chapter discusses some of the other objects and their internal computer representation. This chapter be gins by discussing the fl oating point (real) numeric format. After inte ger representation, oating point representation is the second most popular numeric format in use on modern computer sys - tems 1 . Although the fl oating point format is some what comple x, the necessity to handle non-inte ger calcu - lations in modern programs requires that you understand this numeric format and its limitations. Binary Coded Decimal ( BCD) is another numeric data representation that is useful in certain conte xts. Although BCD is not suitable for general purpose arithmetic, it is useful in some embedded applications. The principle benefi t of the BCD format is the ease with which you can con v ert between string and BCD for - mat. When we look at the BCD format a little later in this chapter , you’ ll see wh y this is the case. Computers can represent all kinds of dif ferent objects, not just numeric v alues. Characters are, unques - tionably , one of the more popular data types a computer manipulates. In this chapter you will tak e a look at a couple of dif ferent w ays we can represent indi vidual characters on a computer system. This chapter dis - cusses tw o of the more common character sets in use today: the ASCII character set and the Unicode charac - ter set. This chapter concludes by discussing some common non-numeric data types lik e pix el colors on a video display , audio data, video data, and so on. Of course, there are lots of dif ferent representations for an y kind of standard data you could en vision; there is no w ay tw o chapters in a te xtbook can co v er them all. (And that’ s not e v en considering specialized data types you could create). Ne v ertheless, this chapter (and the last) should gi v e you the basic idea behind representing data on a computer system. 4.2 An Introduction to Floating Point Arithmetic Inte ger arithmetic does not let you represent fractional numeric v alues. Therefore, modern CPUs sup - port an approximation of r eal arithmetic: fl oating point arithmetic. A big problem with fl oating point arith - metic is that it does not follo w the standard rules of algebra. Ne v ertheless, man y programmers apply normal algebraic rules when using fl oating point arithmetic. This is a source of defects in man y programs. One of the primary goals of this section is to describe the limitations of fl oating point arithmetic so you will under - stand ho w to use it properly .
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/08/2011 for the course CS 101 taught by Professor Jitenderkumarchhabra during the Summer '11 term at National Institute of Technology, Calicut.

Page1 / 32

MoreDataRepresentation - More Data Representation More Data...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online