Posts

Showing posts with the label verilog

Efficient Implementation of Digital Modulation Techniques on FPGA Using Verilog

BASK : `timescale 1ns/1ps module sine_wave(Clk,data_out); //declare input and output     input Clk;     output [7:0] data_out; //declare the sine ROM - 30 registers each 8 bit wide.       reg [7:0] sine [0:29]; //Internal signals       integer i;       reg [7:0] data_out;  //Initialize the sine rom with samples.      initial begin         i = 0;         sine[0] = 0;         sine[1] = 16;         sine[2] = 31;         sine[3] = 45;         sine[4] = 58;         sine[5] = 67;         sine[6] = 74;         sine[7] = 77;         sine[8] = 77;         sine[9] = 74;         sine[10] = 67;         sine[11] = 58;         ...

Design of an 8-bit Cordic-based Sine and Cosine Processor using Verilog

Design of an 8-bit Cordic-based Sine and Cosine Processor using Verilog Code: //////////////////////////////////////RESET CONTROLLER//////////////////////////////////////// module reset_controller(clk, rst, rst_correct); input rst, clk; output reg rst_correct; initial begin rst_correct = 1; end always@(rst) begin rst_correct = rst; end endmodule ////////////////////////////////////////LATCH///////////////////////////////////////////////// module latch(rst, show, xf, yf, cos, sin, neg_quadrant); input show, rst; input neg_quadrant;  input [15:0]xf, yf; output reg [16:0]cos, sin; initial begin cos = 0; sin = 0; end always@(rst) begin sin <= sin; cos <= cos; end always@(show) begin if(neg_quadrant) begin sin <= ~(yf[15:0])+1; end else sin <= yf[15:0]; cos <= xf[15:0]; end endmodule //////////////////////////////////////LOOK UP TABLE/////////////////////////////////////// module LUT(rst, rst1, clk, dir, theta, show); input wire clk, dir, rst; output show; output reg rst1...