A code writing by Verilog which can find medium value. With a C file to see the simulation results. A co-design example of C and Verilog.