1 ECE 459/559 – Secure and Trustworthy Computer Hardware Design Midterm Exam Spring 2023 Due on Thursday, March 23, 2023 by 11 pm through Canvas Name________________________________ There are 5 problems in this exam and is 3 pages. The exam is 50 points. Cheating Policy: Students must individually work on the exam. Students are not to copy or to share their answers. Penalties for an academic offense range from a zero on the exam (for a first offense) to suspension or expulsion. Please attach sheets you use and number them. Problem 1. (10 Points) Use the following values (in hexadecimal notation): plaintext = 0000 0000 0000 0000, key = BBBB 5555 5555 FFFF FFFF. (a) Calculate the state of PRESENT-80 after the execution of one round. (b) Now calculate the round key for the second round. Problem 2. (10 points) (a) Given the following state matrix in AES, show what it would look like after applying the sub bytes step? 3E 67 A8 5A 1F 96 6B 06 23 FF AB 9C 10 65 9E 43 (b) Now, apply the shift rows operation to your result from part a, what is the resulting state matrix? 2 Problem 3 (8 points). Write the Verilog code of the 4-bit shift register that should perform the following functions (Fig. 1). Hint: you can use an always block with case statements. Fig.1. Working of the 4-bit shift register. Problem 4 (12 points): Write the Verilog code for the 5-bit S-box that works as shown in the Fig. 2 below: 3 Problem 5. (10 Points) (a) Write the Boolean equation implemented by the following CMOS logic. (a) A majority function is generated in a combinational circuit when the output is equal to 1 if the input variables have more 1’s than 0’s. The output is 0 otherwise. Design a 3-input majority function in CMOS.