Jump to content
ELFORUM - Forumul electronistilor

impartirea a doua numere in verilog


Guest tayson

Recommended Posts

buna.ma poate ajuta cineva si pe mine cu impartirea a doua numere pe 8 biti fara semn.eu am scris o bucata de cod insa nu imi ese binemodule div2(cat,rest,deimpartit,impartitor); input [7] deimpartit,impartitor; output cat,rest; reg [8] diff; reg [8] caq; reg [7] rest =0; reg [7] cat=0 ; integer bit = 8; always @(*) beginfor (bit=0;bit<8;bit=bit+1)beginif (bit ==0) begin caq[7] = deimpartit[7]; end caq=caq<<1; if(caq[8]>=impartitor[7])begin caq[8]=caq[8]-impartitor[7]; caq[0]=1;end else begin caq[0]=0;end endcat[3]=caq[3];rest[3]=caq[7]; endendmodule

Link to comment
  • Replies 0
  • Created
  • Last Reply

Popular Days

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.Terms of Use si Guidelines