Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > quetion about verilog code..

Reply
Thread Tools

quetion about verilog code..

 
 
hsc6320 hsc6320 is offline
Junior Member
Join Date: Nov 2011
Posts: 1
 
      11-26-2011
I'm from korean and i'm a university student in the korea
I'm 24 years old.. i can't speak english well. i hope you to understand my english skill
because i have to hurry up this code, i'm writing a this thread

i'm studying verilog
but, this code is generated problem
I can't understand this error....
I must to complete this code
please..ㅠㅠ
I want to your comment

Error massage is "near ' data_1' : syntax error, unexpected 'IDENTIFIER' "


module enco (code,code_1, data_1,data_2);
output [3:0] code;
output [3:0] code_1;
input [0:7] data_1;
input [8:15] data_2;
reg [3:0] code;
reg [3:0] code_1;

always@(data_1)
begin
if(data_1[0] == 4'b0000
data_1[1] == 4'b0010,
data_1[2] == 4'b0010,
data_1[3] == 4'b0010,
data_1[4] == 4'b0010,
data_1[5] == 4'b0010,
data_1[6] == 4'b0000,
data_1[7] == 4'b0000)
code = 5;
if(data_1[0] == 4'b0000
data_1[1] == 4'b0101,
data_1[2] == 4'b0101,
data_1[3] == 4'b0111,
data_1[4] == 4'b0001,
data_1[5] == 4'b0001,
data_1[6] == 4'b0000,
data_1[7] == 4'b0000)
code = 9;
if(data_1[0] == 4'b0000
data_1[1] == 4'b0111,
data_1[2] == 4'b0100,
data_1[3] == 4'b0111,
data_1[4] == 4'b0101,
data_1[5] == 4'b0111,
data_1[6] == 4'b0000,
data_1[7] == 4'b0000)
code = 12;
if(data_1[0] == 4'b0000
data_1[1] == 4'b0111,
data_1[2] == 4'b0101,
data_1[3] == 4'b0001,
data_1[4] == 4'b0001,
data_1[5] == 4'b0001,
data_1[6] == 4'b0000,
data_1[7] == 4'b0000)
code = 8;

if(data_1[0] == 4'b0000
data_1[1] == 4'b0111,
data_1[2] == 4'b0101,
data_1[3] == 4'b0111,
data_1[4] == 4'b0101,
data_1[5] == 4'b0111,
data_1[6] == 4'b0000,
data_1[7] == 4'b0000)
code = 13; else
code = 4'b0000;
end

always@(data_2)
begin
if(data_2[8] == 4'b0000
data_2[9] == 4'b0010,
data_2[10] == 4'b0010,
data_2[11] == 4'b0010,
data_2[12] == 4'b0010,
data_2[13] == 4'b0010,
data_2[14] == 4'b0000,
data_2[15] == 4'b0000)
code_1 = 5;
if(data_2[8] == 4'b0000
data_2[9] == 4'b0101,
data_2[10] == 4'b0101,
data_2[11] == 4'b0111,
data_2[12] == 4'b0001,
data_2[13] == 4'b0001,
data_2[14] == 4'b0000,
data_2[15] == 4'b0000)
code_1 = 9;
if(data_2[8] == 4'b0000
data_2[9] == 4'b0111,
data_2[10] == 4'b0100,
data_2[11] == 4'b0111,
data_2[12] == 4'b0101,
data_2[13] == 4'b0111,
data_2[14] == 4'b0000,
data_2[15] == 4'b0000)
code_1 = 12;
if(data_2[8] == 4'b0000
data_2[9] == 4'b0111,
data_2[10] == 4'b0101,
data_2[11] == 4'b0001,
data_2[12] == 4'b0001,
data_2[13] == 4'b0001,
data_2[14] == 4'b0000,
data_2[15] == 4'b0000)
code_1 = 8;

if(data_2[8] == 4'b0000
data_2[9] == 4'b0111,
data_2[10] == 4'b0101,
data_2[11] == 4'b0111,
data_2[12] == 4'b0101,
data_2[13] == 4'b0111,
data_2[14] == 4'b0000,
data_2[15] == 4'b0000)
code_1 = 13; else
code_1 = 4'b0000;
end
endmodule
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Frame related quetion - to enable cookies amitprasad.one@gmail.com ASP .Net 1 12-02-2005 10:56 AM
voip quetion Evil Raphy VOIP 18 07-19-2005 03:25 AM
Quetion on "RUN" Hen Computer Support 7 09-17-2004 06:10 PM
Newbye quetion: Why a double can store more number than a long ? jose luis fernandez diaz C++ 13 05-05-2004 04:57 AM
RAM Quetion Computer Support 1 02-22-2004 09:12 PM



Advertisments