Introduction to Computing Systems: From Bits and Gates to C and Beyond
Format: PDF / Kindle (mobi) / ePub
Introduction to Computing Systems: From bits & gates to C & beyond, now in its second edition, is designed to give students a better understanding of computing early in their college careers in order to give them a stronger foundation for later courses. The book is in two parts: (a) the underlying structure of a computer, and (b) programming in a high level language and programming methodology.
To understand the computer, the authors introduce the LC-3 and provide the LC-3 Simulator to give students hands-on access for testing what they learn. To develop their understanding of programming and programming methodology, they use the C programming language. The book takes a "motivated" bottom-up approach, where the students first get exposed to the big picture and then start at the bottom and build their knowledge bottom-up. Within each smaller unit, the same motivated bottom-up approach is followed. Every step of the way, students learn new things, building on what they already know. The authors feel that this approach encourages deeper understanding and downplays the need for memorizing. Students develop a greater breadth of understanding, since they see how the various parts of the computer fit together.
Sign-EXTension, often abbreviated SEXT. Sign-extension is performed in order to be able to operate on bit patterns of different lengths. It does not affect the values of the numbers being represented. 2.5.3 Overflow Up to now, we have always insisted that the sum of two integers be small enough to be represented by the available bits. What happens if such is not the case? You are undoubtedly familiar with the odometer on the front dashboard of your automobile. It keeps track of how many miles
logic circuits and in digital computers. There are millions of inverters (NOT gates) in the Pentium IV microprocessor. As a convenience, we can represent each of these gates by standard symbols, as shown in Figure 3.8. The bubble shown in the inverter, NAND, and NOR gates signifies the complement (i.e., NOT) function. From now on, we will not draw circuits showing the individual transistors. Instead, we will raise our level of abstraction and use the symbols shown in Figure 3.8. (a) Inverter
on 20, followed by one 95 chapter 3 Digital Logic Structures Figure 3 . 2 4 Combination locks complete turn to the left, ending on 22, followed by one turn to the right, ending on 3. That is, even though the final position of the dial is 3, the lock would not open. Why? Because the lock stores the previous rotations and makes its decision (open or don't open) on the basis of the current input value (R3) and the history of the past operations. This mechanism is a simple example of a
and the counter is decremented so we can detect whether there are any more integers left to add. Each time the loop body executes is called one iteration of the loop. There are two common methods for controlling the number of iterations of a loop. One method we just examined: the use of a counter. If we know we wish to execute a loop n times, we simply set a counter to n, then after each execution of the loop, we decrement the counter and check to see if it is zero. If it is not zero, we set the
we will get the character of interest from the keyboard, and that we must examine all the characters in a file and determine how many are identical to the character obtained from the keyboard. Finally, we must output the result. 160 chapter 6 Programming (c) Figure 6.3 (d) Stepwise refinement of the character count program (continued) To do this, we will need a mechanism for scanning all the characters in a file, and we will need a counter so that when we find a match, we can increment