Question: I have written Verilog code that allows real - time input of arbitrary characters using the cursor, displaying them on a 2 - line (
I have written Verilog code that allows realtime input of arbitrary characters using the cursor, displaying them on a line xdisplay windowLCD across LINEand LINEPlease modify my code by adding an input to allow the cursor to switch between LINEand LINEin the Verilog code.
module LCDcontrollerrst CIk. Icde Icdrs Icdrw Icddata; Ied, numberbtn controlbtn:
input rst clk;
input : numberbtn;
input : controlbtn:
wire : rumberbtnt:
wite : controlbtnt:
oneshotunlversal #wtH Aclk rstnumberbtn: controlbtn:numberbtnt: controlbint::
output Icde Iodrs Icdrm:
output reg : Ioddata:
output reg : led:
wire lode:
reg ledrs lodrw:
feg : ont:
reg : state:
parameter DELAY b
FUNCTIONSET b
DISPONOFF b
ENTRYMODE b
SETADORESS b
DELAYT b
WRITE b
CURSOR b;
always @posedge clk or negedge rst
begin
ifIrst begin
state DELAY:
led b:
end
else begin
casestate
DELAY : bEgin
ifcnt state FUNCTIONSET:
led b:
FUNCTIONSET : begin
ifcnt state DISPONOFF;
led b:
end
DISPONDFF : begin
ifcnt state ENTRYMODE;
led b;
end
ENTRYMODE : begin
ifcnt state SETADORESS:
led b;
end
SETADORESS : begin
ifcnt state DELAYTi
led b;
end
DELAYT : begin
state numberbtnt HRITE : lcontrolbtnt CURSOR : OELAYT;
led b;
end
MRITE: begin
Ifcnt state DELAYT:
led b:
end
CURSOR: begin
ifcnt state DELAYT:
led b:
end
endcase
end
end
always posedge clk or negedge rst
begin
ifIrst
cnt b;
else
begin
casestate
DELAY :
ifcnt ont ;
else cnt cnt;
FUNCTIONSET :
ifcnt cnt ;
else cnt cnt ;
OISPONOFF :
ifcnt s cnt ;
else cnt cnt ;
ENTRY MODE:
if cnt cnt ;
else cnt cnt ;
SETADDRESS :
ifcnt cnt ;
else ont cnt :
OELAYT :
cnt & & ;
MRITE:
ifcnt cnt ;
else cnt cnt :
CURSOR :
ifcnt cnt :
else cnt cnt ;
endcase
end
end
always fposedge clk or negedge rst
begin
iflrst
lodrs ledri Icddatab;
else
begin
casestate
FUNCTIONSET :
lcdrs Icdrm Icddatab;
OISPONOFF :
lodrs Icdrw Icddatab:
ENTRYMOOE:
lcdrs lcdrw Icddatab;
SETADLRESS :
lcdrs Icdrw Icddatab;
DELAYT :
lodrs icdrw Icddatab:
ifcnt begin
casenumberbtn
b:ledrs Icdrw Icddatab;
b : lcdrs Icdrw Icddatab;
b : Icdrs Icdriw, Icddatab;
b : lcdrs Ictrm Icddatab;
b : lcdrs Icdrm Icddatab;
b : lodrs Icdrw; Icddatab;
b : lcdrs Icdrw Icddatab;
b : lcdrscdrw Icddata<
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
