Continue to Site

# circuit for remainder for divide by 64

Status
Not open for further replies.

#### sun_ray

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
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
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

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
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
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

rabhishek91

### rabhishek91

Points: 2

#### KlausST

##### Super Moderator
Staff member
Hi,

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

Or use "AND 0x003F".

Klaus

Status
Not open for further replies.