Skip to content

All Sample Codes

IMPORTANT NOTE

Links to repositories for sample codes various topics are given below. Click on the respective links to access the sample code repositories.:

  1. Introduction to Verilog
  2. Finite State Machines
  3. Single Cycle MIPS Processor
  4. Registers
  5. MIPS

Introduction to Verilog Sample Codes

  1. 8 Bit AND Gate
  2. Half Adder
  3. Full adder
  4. Full Adder Using Half Adders
  5. Full Subtractor
  6. 4 Bit Adder Subtracter Gate level
  7. 8 Bit Binary Adder
  8. 8 Bit binary subtractor
  9. 8:1 MUX Gate level
  10. ALU Behavioural
  11. BCD Adder

Finite State Machines Sample Codes

  1. Chess Clock
  2. Mealy Machine
  3. Moore Machine
  4. Vending Machine
  5. Simple Cycle Detector
  6. Protocol Decoder with Error Check
  7. Elevator Controller
  8. Key Debouncer
  9. Mealy Cycle Detector
  10. Muller C-Element Detector
  11. Dual Clock Traffic Light Controller

Registers Sample Codes

  1. Implement a 4-bit register using D flip-flops.
  2. Implement an 8-bit register using behavioral modeling with a single read and write port such that both read and write operations can occur simultaneously, but when they do read is given more priority.
  3. Implement an 8-bit SISO shift register using behavioral modeling.
  4. Implement an 8-bit SIPO shift register using behavioral modeling.
  5. Implement an 8-bit PISO shift register using behavioral modeling.
  6. Implement an 8-bit PIPO shift register using behavioral modeling.
  7. Implement an 8-bit register with 1 read port and 2 write ports. : Either read or write is permitted at a time and when you perform write, you are to write through the two write ports alternately
  8. Implement an 8-bit register file with 8 registers such that only a read or write can oc cur at a time.
  9. Implement a 64-bit register file with 32 register with 4 read ports and 2 write ports. Multiple operations can occur at a time, but the lower port is given more priority in such cases. Read > Write .
  10. Implement a 4-bit universal shift register.

MIPS Assembly Codes

Basic Integer and String Handling

  1. Reversing 2 digit number Code
  2. Calculating Average Marks Code
  3. Finding Spy Number Code

Floating Point Handling

  1. Farenheit to Celcius Code
  2. Maximum and Minimum in Float Array Code
  3. Round off to n digits Code

Integer Array Handling

  1. Introduction to Integer Arrays Code | Video
  2. Sum of Elements of an Array Code | Video
  3. Greatest Element in Array Code | Video
  4. Merge 2 Sorted Arrays Code | Video
  5. Highest and Lowest occurrence of an element in an array Code | Video
  6. Binary Search Code | Video
  7. Quicksort Code | Video

2-D Integer Array Handling

  1. Taking Input Code
  2. Printing a Matrix Code
  3. Sum of Two Matrices Code

String Handling (advanced)

  1. Traversal of Strings Code | Video
  2. Length of String Code | Video
  3. Palindrome Check Code | Video
  4. Concatenation of strings Code | Video