Aug 21, 2014 #1 S sun_ray 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.
Please provide a circuit that can provide the remainder when any 16 bit input to the circuit is divided by 64.
Aug 21, 2014 #2 FvM Super Moderator Staff member Joined Jan 22, 2008 Messages 52,419 Helped 14,749 Reputation 29,780 Reaction score 14,100 Trophy points 1,393 Location Bochum, Germany Activity points 298,094 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.
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.
Aug 21, 2014 #3 D dipin Full Member level 4 Joined Jul 16, 2014 Messages 223 Helped 14 Reputation 28 Reaction score 14 Trophy points 18 Activity points 1,731 sun_ray said: Please provide a circuit that can provide the remainder when any 16 bit input to the circuit is divided by 64. Click to expand... 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 said: Please provide a circuit that can provide the remainder when any 16 bit input to the circuit is divided by 64. Click to expand... 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]
Aug 24, 2014 #4 S sun_ray 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 Will that be synthesizable if modulo operator is used? - - - Updated - - - dipin Can you please explain how is it bringing remainder? Regards
Aug 24, 2014 #5 FvM Super Moderator Staff member Joined Jan 22, 2008 Messages 52,419 Helped 14,749 Reputation 29,780 Reaction score 14,100 Trophy points 1,393 Location Bochum, Germany Activity points 298,094 Will that be synthesizable if modulo operator is used? Click to expand... modulo 2^n simpy synthesises as a shift operation, other numbers infer a divider core, if supported by the respective tool.
Will that be synthesizable if modulo operator is used? Click to expand... modulo 2^n simpy synthesises as a shift operation, other numbers infer a divider core, if supported by the respective tool.
Aug 25, 2014 #6 D dipin 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? Click to expand... 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
dipin Can you please explain how is it bringing remainder? Click to expand... 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
Aug 25, 2014 #7 KlausST Advanced Member level 7 Joined Apr 17, 2014 Messages 25,170 Helped 4,868 Reputation 9,757 Reaction score 5,540 Trophy points 1,393 Activity points 168,412 Hi, Just use bit 0 ...5 of the 16 bit input. Or use "AND 0x003F". Klaus