Verilog do VHDL

T

Tom2

Guest
Je někdo, kdo mi může pomoci, aby tyto prostředky Verilog VHDL kódu? Kód:Modul vga_controller (SynchClock, a, b, c, d, inRed, inGreen, inBlue, červená, zelená, modrá, Hsynch, Vsynch, prázdné, synchronizace, mem_address);
vstup SynchClock;
vstup a, b, c, d;
příkon [7:0] inRed, inGreen, inBlue;
výkon [7:0] červená, zelená, modrá;
Výstup Hsynch, Vsynch;
Výstup prázdné, synch;
Výstup reg [16:0] mem_address;

reg [7:0] = 8'b00000000 červená, zelená = 8'b00000000, modrá = 8'b00000000;
reg Vsynch = 0, Hsynch = 0;
reg blank = 1, synchronizace = 1;
reg [19:0] 20'b00000000000000000000 = x2, y2 = 20'b00000000000000000000;

reg [9:0] Hcount = 10'b0000000000, Vcount = 10'b0000000000;
reg [9:0] PixelRow = 10'b0000000000, PixelCol = 10'b0000000000;

Vždy @ (negedge SynchClock) začíná
blank = 1'b1;
synch = 1'b1;

if (Hcount == 799) Hcount = 0;
else Hcount = Hcount 1;
if (Hcount> = 661 & & Hcount <= 756) Hsynch = 0;
else Hsynch = 1;
if (Vcount> = 525 & & Hcount> = 756) Vcount = 0;
else if (Hcount == 756) Vcount = Vcount 1;
if (Vcount> = 491 & & Vcount <= 493) Vsynch = 0;
else Vsynch = 1;
if (Hcount <= 640) PixelCol = Hcount;
if (Vcount <= 480) PixelRow = Vcount;
if (Hcount <= 640 & & Vcount <= 480) begin
if (a & b & c & d) begin
if (PixelCol <= 479 & & PixelCol> = 159 & & PixelRow <= 359 & & PixelRow> = 119) begin
mem_address = ((PixelRow-119) * 320) PixelCol-159;
Red = inRed;
Zelená = inGreen;
Modrá = inBlue;
konec
else begin
Red = 8'b11111111;
Zelená = 8'b11111111;
Modrá = 8'b11111111;
konec
konec

if (a & b & c & ~ d) begin
/ / If (PixelCol <= 479 & & PixelCol> = 159 & & PixelRow <= 359 & & PixelRow> = 119) begin
x2 = 724 * 724 * PixelCol/1024 PixelRow/1024;
y2 =- PixelCol/1024 724 * 724 * PixelRow/1024;
mem_address = ((y2-119) * 320) x2-159;
Red = inRed;
Zelená = inGreen;
Modrá = inBlue;
konec
/ * Konec
else begin
Red = 8'b11111111;
Zelená = 8'b11111111;
Modrá = 8'b11111111;
konec
* /
if (a & b & ~ c & d) begin
if (PixelCol <= 159 & & PixelRow <= 439 & & PixelRow> = 119) begin
x2 = PixelRow;
y2 =- PixelCol;
mem_address = ((y2 159) * 320) x2-119;
Red = inRed;
Zelená = inGreen;
Modrá = inBlue;
konec
else begin
Red = 8'b11111111;
Zelená = 8'b11111111;
Modrá = 8'b11111111;
konec
konec
if (a & b & c & ~ ~ d) begin
x2 =- PixelCol/1024 724 * 724 * PixelRow/1024;
y2 =- 724 * PixelCol/1024 - 724 * PixelRow/1024;
mem_address = ((y2-119) * 320) x2-159;
Red = inRed;
Zelená = inGreen;
Modrá = inBlue;
konec
if (~ & b & c & d) begin
if (PixelCol <= 159 & & PixelRow <= 119) begin
x2 =- PixelCol;
y2 =- PixelRow;
mem_address = ((y2 119) * 320) x2 159;
Red = inRed;
Zelená = inGreen;
Modrá = inBlue;
konec
else begin
Red = 8'b11111111;
Zelená = 8'b11111111;
Modrá = 8'b11111111;
konec
konec
if (~ & b & c & ~ d) begin
x2 =- 724 * PixelCol/1024 - 724 * PixelRow/1024;
y2 = 724 * PixelCol/1024 - 724 * PixelRow/1024;
mem_address = ((y2-119) * 320) x2-159;
Red = inRed;
Zelená = inGreen;
Modrá = inBlue;
konec
if (a & b & ~ ~ c & d) begin
if (PixelCol <= 399 & & PixelCol> = 159 & & PixelRow <= 119) begin
x2 = - PixelRow;
y2 = PixelCol;
mem_address = ((y2-159) * 320) x2 119;
Red = inRed;
Zelená = inGreen;
Modrá = inBlue;
konec
else begin
Red = 8'b11111111;
Zelená = 8'b11111111;
Modrá = 8'b11111111;
konec
konec
if (a & b & ~ ~ ~ c & d) begin
x2 = 724 * PixelCol/1024 - 724 * PixelRow/1024;
y2 = 724 * 724 * PixelCol/1024 PixelRow/1024;
mem_address = ((y2-119) * 320) x2-159;
Red = inRed;
Zelená = inGreen;
Modrá = inBlue;
konec
/ * If (~ & b & c & d) begin
if (~ & b & c & ~ d) begin
if (~ ~ & b & c & d) begin
if (~ & b & c & ~ ~ d) begin
if (~ ~ & b & c & d) begin
if (~ ~ & b & c & ~ d) begin
if (~ & ~ b ~ c & & d) begin
if (~ ~ & b & c & ~ ~ d) begin
if (a & b & c & ~ d) begin
if (PixelCol <320 & & PixelRow> 240) begin / / KATW aristera xwris GREEN
mem_address = ((PixelRow - 240) * 320) PixelCol;
Red = inRed;
Zelená = 8'b00000000;
Modrá = inBlue;
konec
if (PixelCol> = 320 & & PixelRow <= 240) begin / / panw deksia xwris BLUE
mem_address = (PixelRow * 320) PixelCol - 320;
Red = inRed;
Zelená = inGreen;
Modrá = 8'b00000000;
konec
if (PixelCol> = 320 & & PixelRow> 240) begin / / KATW deksia xwris RED
mem_address = ((PixelRow - 240) * 320) PixelCol - 320;
Red = 8'b00000000;
Zelená = inGreen;
Modrá = inBlue;
konec
* / Konec
else begin
Red = 8'b00000000;
Zelená = 8'b00000000;
Modrá = 8'b00000000;
konec
konec
endmodule

 
Potřebujete behaviorálního popisu nebo je to dobré pro tebe i strukturální jeden?

 
tento dokument jsem s tímto žádné přesné kód pro ur design, ale to je také VGA rozhraní ve VHDL

 

Welcome to EDABoard.com

Sponsor

Back
Top