Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

circuit for remainder for divide by 64

Status
Not open for further replies.

sun_ray

Advanced Member level 3
Advanced Member level 3
Joined
Oct 3, 2011
Messages
772
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,298
Activity points
6,828
Please provide a circuit that can provide the remainder when any 16 bit input to the circuit is divided by 64.
 

FvM

Super Moderator
Staff member
Advanced Member level 7
Joined
Jan 22, 2008
Messages
51,209
Helped
14,651
Reputation
29,580
Reaction score
13,795
Trophy points
1,393
Location
Bochum, Germany
Activity points
292,721
It's a bit strange when an experienced Edaboard member makes his questions sound like a first year's student homework problem...

Isn't the answer a simple part select (Verilog) respectively slice (VHDL)? You can also desribe it with a modulo operator.
 

dipin

Full Member level 4
Full Member level 4
Joined
Jul 16, 2014
Messages
223
Helped
14
Reputation
28
Reaction score
14
Trophy points
18
Activity points
1,731
Please provide a circuit that can provide the remainder when any 16 bit input to the circuit is divided by 64.
please correct me if iam wrong
copy the dividend into MSB of 32 bit register , right shift 4 times you will get quotient [31:16] and fractional remainder [15:0]
 

sun_ray

Advanced Member level 3
Advanced Member level 3
Joined
Oct 3, 2011
Messages
772
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,298
Activity points
6,828
FvM
Will that be synthesizable if modulo operator is used?

- - - Updated - - -

dipin

Can you please explain how is it bringing remainder?

Regards
 

FvM

Super Moderator
Staff member
Advanced Member level 7
Joined
Jan 22, 2008
Messages
51,209
Helped
14,651
Reputation
29,580
Reaction score
13,795
Trophy points
1,393
Location
Bochum, Germany
Activity points
292,721
Will that be synthesizable if modulo operator is used?
modulo 2^n simpy synthesises as a shift operation, other numbers infer a divider core, if supported by the respective tool.
 

dipin

Full Member level 4
Full Member level 4
Joined
Jul 16, 2014
Messages
223
Helped
14
Reputation
28
Reaction score
14
Trophy points
18
Activity points
1,731
dipin

Can you please explain how is it bringing remainder?

take number 22 ,it sbinary equals 0000 0000 0001 0110
copy it to MSB of 32 bit register 0000 0000 0001 0110 0000 0000 0000 0000

then 2^4 =16 ,so shift 4 times 0000 0000 0000 0001 0110 0000 0000 0000

22/16= 1.375
quotient(msb)=0000 0000 0000 0001 =1
(lsb) remainder(in fraction)=0110 0000 0000 0000 = 2^-2+2^-3
=.25+.125
=.375

the output fractional accurcy is depends upon the number of fractional bits we are using
regards
 

KlausST

Super Moderator
Staff member
Advanced Member level 7
Joined
Apr 17, 2014
Messages
23,493
Helped
4,757
Reputation
9,535
Reaction score
5,172
Trophy points
1,393
Activity points
155,819
Hi,

Just use bit 0 ...5 of the 16 bit input.

Or use "AND 0x003F".

Klaus
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top