OpenFive interview question

Write Verilog codes for given questions