Apr 4, 2024 #1 O Omar21 Newbie Joined Apr 4, 2024 Messages 2 Helped 0 Reputation 0 Reaction score 0 Trophy points 1 Activity points 14 Hi, I am coding in Verilog for a Laplacian filter where I am using a kernel as the follow is it correct to insert it like that? Code: // Define the Laplacian filter kernel reg [31:0] kernel [0:2][0:2]; initial begin kernel[0][0] = 0; kernel[0][1] = 1; kernel[0][2] = 0; kernel[1][0] = 1; kernel[1][1] = -4; kernel[1][2] = 1; kernel[2][0] = 0; kernel[2][1] = 1; kernel[2][2] = 0; end
Hi, I am coding in Verilog for a Laplacian filter where I am using a kernel as the follow is it correct to insert it like that? Code: // Define the Laplacian filter kernel reg [31:0] kernel [0:2][0:2]; initial begin kernel[0][0] = 0; kernel[0][1] = 1; kernel[0][2] = 0; kernel[1][0] = 1; kernel[1][1] = -4; kernel[1][2] = 1; kernel[2][0] = 0; kernel[2][1] = 1; kernel[2][2] = 0; end
Apr 5, 2024 #2 dpaul Advanced Member level 5 Joined Jan 16, 2008 Messages 1,802 Helped 317 Reputation 635 Reaction score 343 Trophy points 1,373 Location Germany Activity points 13,096 @Omar21 Please use the compiler of your simulator, it will flag all your RTL errors! Upvote 0 Downvote
Apr 17, 2024 #3 O Omar21 Newbie Joined Apr 4, 2024 Messages 2 Helped 0 Reputation 0 Reaction score 0 Trophy points 1 Activity points 14 dpaul said: @Omar21 Please use the compiler of your simulator, it will flag all your RTL errors! Click to expand... it gives 0 errors Upvote 0 Downvote
dpaul said: @Omar21 Please use the compiler of your simulator, it will flag all your RTL errors! Click to expand... it gives 0 errors
Apr 18, 2024 #4 D.A.(Tony)Stewart Advanced Member level 7 Joined Sep 26, 2007 Messages 9,062 Helped 1,824 Reputation 3,647 Reaction score 2,219 Trophy points 1,413 Location Richmond Hill, ON, Canada Activity points 59,776 I don't know if values are your concern or the syntax, but Python uses this for a 5th order normalize array. array([[ 0, 0, 0, 0, 0], [ 0, 9, -2, -3, -4], [ 0, -2, 16, -6, -8], [ 0, -3, -6, 21, -12], [ 0, -4, -8, -12, 24]]) FWIW. No comment on syntax. Compiler is happy. Upvote 0 Downvote
I don't know if values are your concern or the syntax, but Python uses this for a 5th order normalize array. array([[ 0, 0, 0, 0, 0], [ 0, 9, -2, -3, -4], [ 0, -2, 16, -6, -8], [ 0, -3, -6, 21, -12], [ 0, -4, -8, -12, 24]]) FWIW. No comment on syntax. Compiler is happy.