Reference no: EM132727876
Chapter 3:
Exercises:
1) Check the internet to see the differences among the terms simulation, emulation, and imitation as related to computer projects.
2) Modify listing 3.1 and change the inputs from switches to keys. The KEYs and LEDRs must be [1:0].
3) Modify listing 3.1 and change the outputs from LEDS to seven-segment hex display 2. The range for both the SW and HEX2 must be [7:0] on the DE10-Lite
Chapter 4:
Exercises:
1) Logical operations such as a two-input AND gate can be described by a four-row truth table. Using a case statement as shown in listing 4.5, create an AND function and test it with switches and an LED output. Likewise implement the other gates: XOR, OR, NAND, and NOR. The NOT inverter can be implemented with a single if and else.
2) Use an eight-row truth able to implement a three-input OR gate. Instead of entering all eight lines of the case statement, enter the one for all three inputs being zero and then use "others" to represent the remaining seven cases which have the same result.
3) Use the gates from the first two exercises to implement a half adder and a full adder.
4) Use the above exercise to implement a 4-bit adder
Chapter 7:
Exercises:
1) Use the calculator from listing 7.3 to add the sequence: 5, 13, 17 and 22. Of course, you had to convert those numbers from decimal to binary before entering them
2) Again, using the calculator, add the numbers 30 and 35. What is wrong with the answer? Why are no errors detected?
Exercises:
1) Write the program in machine language to sum five numbers. Convert it to the hexadecimal code and enter it as a replacement for lines 52-57 in listing 8.5. Compile this new listing 8.5 code , download it, and run the program.
2) Write another program as was done in the previous exercise, but this time calculate the vertical parity of 5 numbers, this can be done by doing an exclusive (EOR) on each of the numbers
Exercises:
1) In chapter 8, instructions were entered in hexadecimal, so it was very convenient to have fields line up on 4-bit boundaries. Temporarily modify the code in listing 9.3 so that the immediate bit is adjacent to the second operand.
2) Modify the code to use an integer variable named IP, so each instruction will look like progMod[IP] <= ‘MOV R1,0,R2. Three changes will be necessary:
a) Variable IP must be defined before it is used (integer IP;)
b) The number in brackets (such as [0],[1]) for each assembly language type statement must all be changed to [IP]
c) The IP must then be incremented after each statement by IP=IP+1;
Chapter 10:
Exercises:
1) Modify the ARM program on lines 237 - 242 of listing 10.2 to calculate the AND operation and compare it to a calculated value
2) Modify the same lines from listing 10.2 to write a short ARM program to sum a series of numbers such as 1+2+3+...
a) Initialize R0 to 0, and R1 to 1 using two MOV instructions
b) The third instruction will ADD the contents of R1 to R0
c) The fourth instruction will ADD the immediate value of 1 to register R1
d) The fifth instruction will load an immediate value of 2 into register R15 (the PC). This will force the instruction to be executed to be the one that adds the contents of R1 to R0.