Area Optimized Fpga Implementation of Color Edge Detection: Project Guide - Dept of ETC Group - B
Area Optimized Fpga Implementation of Color Edge Detection: Project Guide - Dept of ETC Group - B
• A method had been published for edge detection , which is called “Fusion
Detection”.
• XILINX ISE 14.7 : Used for design , simulation and synthesis of hard
ware system model in verilog HDL. In Xilinx the target device used to
implement the design isxc3s1500-4fg676
• figure, imshow(uint8(textImage));
•
Major Project Final Presentation(2019), Department of
Group
• -B
end 17
Electronics & Telecommunication Engg
Sobel Core Module Verilog Code
• module sobel( p0, p1, p2, p3, p5, p6, p7, p8, out);
• input [7:0] p0,p1,p2,p3,p5,p6,p7,p8;
• output [7:0] out;
• wire signed [10:0] gx , gy ;
• wire signed [10:0] abs_gx , abs_gy ;
• wire [10:0] sum;
• assign gx=((p2-p0)+((p5-p3)<<1)+(p8-p6));
• assign gy=((p0-p6)+((p1-p7)<<1)+(p2-p8));
• assign abs_gx = (gx[10]? ~gx+1 : gx);
• assign abs_gy = (gy[10]? ~gy+1 : gy);
• assign sum = (abs_gx + abs_gy);
• assign out = (|sum[10:8])?8'hff : sum[7:0];
• endmodule
• assign bus = (bus_rw)? bus_out : 8'dz; // this code enables the duplexing of 'bus'
• assign bus_in = (!bus_rw) ? bus : 8'dz; // -do-
• // codes till 'always' is for 32 sobels
• wire [7:0] out1;
• sobel s1(row1[0],row1[1],row1[2],
• row2[0],row2[2],
• row3[0],row3[1],row3[2],out1);
• wire [7:0] out2;
• .
• .
• .
• wire [7:0] out32;
• sobel s32(row1[31],row1[32],row1[33],
• row2[31],row2[32],
• Row3[31], row3[32],row3[33],out32);
• always @(posedge clk,negedge reset)
• begin
Group -B Major Project Final Presentation(2019), Department of
• if(!reset) 20
Electronics & Telecommunication Engg
Contd…
• write_en <= 1'b1; // this ensures correct write operation
• end
• else if(!data_strobe & bus_rw & !read_en) // condition for reading from FPGA
• begin
• case (RAddr+1) // initially Rcode is written from 1.
• 1:bus_out <= out1; // this block will implement a 32:1 8 bit Vectored MUX
• 2: bus_out <= out2;
• 3: bus_out <= out3;
• .
• .
• 32: bus_out <= out32;
• default: bus_out <= 8'b0;
• endcase
• RAddr <= RAddr + 1; // incrementing to next RAddr location.
• read_en <= 1'b1; // to ensure correct read operation
• End
• else if(!mode_strobe & !bus_rw & !write_en) // condition for indicating FPGA the end of one row
• begin
• if(bus_in == 8'b0110_0110) // '66' is code indicating end of row
• Begin
• for(index=0;index < 34;index = index + 1) // this loop will implement row shift operation
• begin
• row1[index] <= row2[index];
• row2[index] <= row3[index];
• end