sugubai
Newbie level 6
need help frds.. want some idea or verilog code for conversion of octal to decimal... the octal number is (106) base 8 and its binary number are (001 000 110) base 2 all we know..but how to write the verilog code for it.. i tried but it has shown some error... the code is
pls anybody know help me frds
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 module hgf(oct,bin); input [0:2]oct; output [7:0]bin; reg[0:2]n; reg [7:0]k; integer i,d; always@(*) begin n = oct; for(i=0;n<=1;i=i+1) begin d=d+(n%10)* 8**i; n=n/10; end i=1; while(d!=0) begin k = k+(d%2)*i; d=d/2; i=i*10; end end assign bin=k; endmodule
pls anybody know help me frds
Last edited by a moderator: