Chapter 6. Logical Operations, Bit-Shifts, and Bytes

Logic provides the hardware-level foundation for both arithmetic calculations and control of flow in software. Although this chapter stays at the level of the instruction set architecture, we shall seek to demonstrate that integer arithmetic operations can be built out of logical operations applied in appropriate parallel and/or sequential manners.

Early in the twentieth century, tabulating machines processed demographic data from the US Census, printed address labels, and even issued payroll checks. Those electromechanical devices sorted stiff paper cards according to patterns of holes that represented printable characters i.e., one character for each of up to 80 columns on a card. Because of the necessarily large size of the holes, each column had only 12 rows; such columns of holes could encode only small information units.

Digital computers began as instruments for automating calculations in military applications and scientific research. Information units in early computers tended to be dozens of bits in width in order to support algorithms that needed high numerical precision.

As computers become more commonplace, non-numeric applications of computers based on the representation of character data continue to grow in importance. Since about 1980, all computers have standardized on the 8-bit byte as the smallest practicable information unit. Larger supported sizes of information units are almost invariably multiples of the byte.

At the extremes, one can study computer hardware organization using a top-down approach (following Stallings) or a bottom-up approach (following Tanenbaum). In studying the impact of hardware choices on software implementations, we chose a less strict path and introduced instructions for integer arithmetic and comparisons involving integers first. In this chapter, we turn to an exploration of logical operations in general (following Langholz et al.) and then to descriptions of the Itanium instructions most closely related to logic.

We shall conclude this chapter with a foretaste of functions and other modular programming techniques through an ad hoc yet workable method for byte-oriented input and output.



ItaniumR Architecture for Programmers. Understanding 64-Bit Processors and EPIC Principles
ItaniumR Architecture for Programmers. Understanding 64-Bit Processors and EPIC Principles
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net