verilog code for ternary content addressable memory
#1

sir,
please send me the verilog code for TCAM using reversible logic.

Thank you
Reply
#2

verilog code for ternary content addressable memory

Content Addressable Memory (CAM)

space.gif


1 //-----------------------------------------------------
2 // Design Name : cam
3 // File Name : cam.v
4 // Function : CAM
5 // Coder : Deepak Kumar Tala
6 //-----------------------------------------------------
7 module cam (
8 clk , // Cam clock
9 cam_enable , // Cam enable
10 cam_data_in , // Cam data to match
11 cam_hit_out , // Cam match has happened
12 cam_addr_out // Cam output address
13 );
14
15 parameter ADDR_WIDTH = 8;
16 parameter DEPTH = 1 << ADDR_WIDTH;
17 //------------Input Ports--------------
18 input clk;
19 input cam_enable;
20 input [DEPTH-1:0] cam_data_in;
21 //----------Output Ports--------------
22 output cam_hit_out;
23 output [ADDR_WIDTH-1:0] cam_addr_out;
24 //------------Internal Variables--------
25 reg [ADDR_WIDTH-1:0] cam_addr_out;
26 reg cam_hit_out;
27 reg [ADDR_WIDTH-1:0] cam_addr_combo;
28 reg cam_hit_combo;
29 reg found_match;
30 integer i;
31 //-------------Code Starts Here-------
32 always @(cam_data_in) begin
33 cam_addr_combo = {ADDR_WIDTH{1'b0}};
34 found_match = 1'b0;
35 cam_hit_combo = 1'b0;
36 for (i=0; i<DEPTH; i=i+1) begin
37 if (cam_data_in[i] && ! found_match) begin
38 found_match = 1'b1;
39 cam_hit_combo = 1'b1;
40 cam_addr_combo = i;
41 end else begin
42 found_match = found_match;
43 cam_hit_combo = cam_hit_combo;
44 cam_addr_combo = cam_addr_combo;
45 end
46 end
47 end
48
49 // Register the outputs
50 always @(posedge clk) begin
51 if (cam_enable) begin
52 cam_hit_out <= cam_hit_combo;
53 cam_addr_out <= cam_addr_combo;
54 end else begin
55 cam_hit_out <= 1'b0;
56 cam_addr_out <= {ADDR_WIDTH{1'b0}};
57 end
58 end
59
60 endmodule
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Tagged Pages: tcam code and testbench,
Popular Searches: content adressable memory ppt, addressable fire alarm labview sample, highway addressable remote transducer protocol, content addressable memory architecture ppt, ternary blended concrete ppt, highway addressable remote transducer, highway addressable remote transducer seminar doc,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  verilog radix 8 booth multiplier 7 3,264 18-10-2017, 11:05 AM
Last Post: jaseela123d
Video verilog code for low power and area efficient carry select adder 2 1,562 02-05-2017, 09:56 AM
Last Post: jaseela123d
  verilog code for linear convolution 1 1,434 12-04-2017, 02:26 PM
Last Post: jaseela123d
  water level controller using verilog 1 724 04-04-2017, 12:29 PM
Last Post: jaseela123d
  matlab code for adaptive differential pulse code modulation 1 1,133 04-04-2017, 11:49 AM
Last Post: jaseela123d
  plastic memory seminars report full papers 1 1,002 04-04-2017, 11:05 AM
Last Post: jaseela123d
  verilog code wallace tree multiplier using compressor 1 829 31-03-2017, 04:16 PM
Last Post: jaseela123d
  vlsi implementation of steganography using fpga with verilog vhdl code 1 1,061 27-03-2017, 03:38 PM
Last Post: jaseela123d
  shift and add multiplication verilog code 1 759 20-03-2017, 12:35 PM
Last Post: jaseela123d
  implementation of reversible multiplier verilog code 1 752 20-03-2017, 11:54 AM
Last Post: jaseela123d

Forum Jump: