Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a VERILOG description of an ALU with two 32-bit inputs, A and B, and a 32-bit output Result (module alu). The result is derived
Write a VERILOG description of an ALU with two 32-bit inputs, A and B, and a 32-bit output Result (module alu). The result is derived from one or both of the inputs according to the value of a 6-bit opcode. The operations that the ALU can perform are listed below: - a+b - ab - |a| (i.e. the absolute value of a) - -a - max(a,b) (i.e. the maximum of a and b) - min(a,b) (i.e. the minimum of a and b ) - avg(a,b) (i.e. the average of a and b - the integer part only and remainder is ignored) - not a - a or b - a and b - a xor b The opcode that will be used to represent each of these operations is determined by the last digit of your students ID number. The table below shows which opcode you should use in your design for each instruction. So, for example if your ID is 1221438 then the last digit is 8. Then a+b is to be represented by opcode 1 , a-b is to be represented by opcode 6,a is to be represented by opcode 13 and so on. (These are shown as denary (base 10) values; your design may use binary or hexadecimal values.) The register file Inside a modern processor there is a very small amount of memory that is used to hold the operands that it is presently working on. This is called the register file, and normally has the following appearance (module reg_file). This is a very small fast RAM, typically holding 3232-bit words, and therefore requiring a 5-bit address to select out one of the 32-bit words. It is unlike normal RAM in that it can process three addresses at the same time, two of which are always read operations, and one of which is always written to. Output 1 produces the item within the register file that is address by Address 1 . Similarly Output 2 produces the item within the register file that is address by Address 2 . Input is used to supply a value that is written into the location addressed by Address 3 . The initial values stored in the register file are determined by the second-from-last digit of your student ID, and are shown in the table below: nber is 6. so item 0 should be 0 , item 1 should be 4616, item 2 should be 11640 , and so on. (N.B. these values are in denary (i.e. base 10). You may need to convert them to binary or hexadecimal.)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started