Digital Systems and Microprocessor Design

H7068 DIGITAL SYSTEMS AND MICROPROCESSOR DESIGN: COURSEWORK 2015 a) List 5 possible advantages or disadvantages of using a custom processor designed in VHDL (such as UoS educational processor) instead of a processor or microcontroller available on the market (such as an Atmel AVR) (5 items) [5 marks] b) Find what is the content of register b after executing the following code. For this, explain line by line the operation performed by the instruction and the resulting register values. mov ra,55 xor rb,rb add rb,ra add rb,rb asr rb [5 marks] c) You are provided with the following partial dump of the memory connected to the educational processor. A program starts at address zero, but we do not know how large it is. Decode the instructions below and write the corresponding program in assembler. Explain what the program does (hint: it is a known mathematical operation). Indicate and discuss what is the likely size of the program. Assume that memory locations from which instructions are never read represent the end of the program. Adr Data ---------- 00 10 04 02 42 01 04 54 00 06 B1 10 08 22 00 0A C0 02 0C 34 01 0E B0 04 10 B0 10 12 63 00 14 3D 25 16 A0 03 [20 marks] d) Consider the instruction "mov [ra], 4B" (assume ra=10h,rb=20h,rc=55h,rd=40h). Assume we are shortly before the clock edge of the "execute" cycle (i.e. at the next rising edge the instruction will be executed). By analyzing the VHDL code, explain what happens inside the educational processor to execute this instruction. Specifically, indicate the state of the following signals (or indicate if undefined): instruction (in cpu.vhd) rrd1 (port of cpuregbank in cpu.vhd) rrd2 (port of cpuregbank in cpu.vhd) rwr (port of cpuregbank in cpu.vhd) d (port of cpuregbank in cpu.vhd) H7068 DIGITAL SYSTEMS AND MICROPROCESSOR DESIGN: COURSEWORK 2015 reg1out (in cpu.vhd) reg2out (in cpu.vhd) source (in cpu.vhd) regwren (in cpu.vhd) ram_we (in cpu.vhd) ram_address (in cpu.vhd) ram_datawr (in cpu.vhd) op (port of cpualu in cpu.vhd) a (port of cpualu in cpu.vhd) b (port of cpualu in cpu.vhd) aluqout (in cpu.vhd) wrdata (in cpu.vhd) finally, summarize the overall processor behavior with this instruction. [20 marks] e) Create a new opcode to generate a random number inside the processor ALU. This requires: 1) to select an unused ALU opcode; 2) to implement a random number generator in VHDL using linear feedback shift registers; 3) to modify the processor ALU to add this new functionality; 4) to write a test the program. Report here the modifications and were made to the processor (provide VHDL code and explanations), specifically the implementation of the random number generator and the modifications to the processor ALU (and other modifications if required). Report the test program: provide the assembler code and the encoded instructions. Indicate the first 5 random numbers that you obtain. [20 marks] f) The final evaluation is to implement your own program. The only requirements are that it makes use of a custom instruction (that you have implemented!), that it fits in the memory of the processor, and that its behavior can be demonstrated in the lab. A suggestion for a custom program is to create the following simple game: a random number R is generated and the user must find it using the switches S on the board. He receives some hints from the program for that. If the number represented by the switches is equal to the random number (S=R), make all the LEDs blink ON and OFF (success!). If S<R then turn on the four righmost LEDs (hint to the player). if S>R then turn on the four leftmost LEDs (hint to the player). The game continues until the number is found. When it is found, the game starts over. [20 marks] g) Explain and justify how much data memory the processor can access with the instruction mov. Explain a realistic option to address more memory involving a hardware modification using the "ext" port. [5 marks] h) Explain how the Educational Processor could be modified to execute an instruction in less than 3 clock cycles. [5 marks]