Data Types
Binary information in digital computers is stored in memory or processor registers.Registers contain either data or control information .Control information is a bit or a group of bits used to specify the sequence of command signals needed for manipulation of the data in other registers. Data are numbers and other binary-code information that are operated on to achieve required computational results. Now we present the most common types of data found in digital computers and show how the various data types are represented in binary-code form in computer registers.
l Numeric data can often be represented as integers .Inunsignde integers ,an n-bit value can range from 0 to 2n-1 .An n-bit signed integer can have any value between -2n-1 and 2n-1-1,inclusive .Both formats can be used in arithmetic algorithms.Some numeric date cannot be represented as integers .These values, which typically include fractional portions,are represented in floating point format in computers. A computer may have special registers and instructions exclusively for floating point data.
l The Boolean values TRUE and FALSE are used often enough to warrant having their own data type ,Boolean ,and assembly language instructions. Typically ,a data value is set to zero to represent FALSE and any nonzero value for TRUE. Boolean assembly language instructions can perform logical operations on these values. Unlike logical instructions ,which generate one result per bit of the operands, Boolean instructions generate only one result. To illustrate the difference ,consider the case in which A=0000 0010 and B=0000 0001 .The logical AND of these binary values produces the result 0000 0000. However ,if they are Boolean values ,A and B are both TRUE,since they are both nonzero .Their Boolean AND must produce a result of TRUE ,represented by a nonzero value.
l Computers must also deal with character data. The characters are stored as binary values encoded using ASCII, EBCDIC, UNICODE, or some other character encoding standards .Rather than arithmetically or logically manipulating characters,a computer may concatenate strings of characters ,replace some characters with others,,or therwise manipulate character strings .Some assembly language instruction sets include instructions to directly maniplate character data. Others use routines constructed from other instructions to achieve the same result.