Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

two 4bit no. when multiplied results in max no. of 1s

Status
Not open for further replies.

pooja_khubbar

Newbie level 6
Joined
Nov 25, 2010
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,389
hello friends
can anyone tell me two 4bit numbers....whose multiplication leads to maximum no of 1s in output.
 

lostinxlation

Advanced Member level 3
Joined
Aug 19, 2010
Messages
701
Helped
197
Reputation
394
Reaction score
184
Trophy points
1,323
Location
San Jose area
Activity points
5,051
well, your question is incomplete, but at my full discretion to expand your question, I'd say you can get as many 1s as you want by 1111 x 0001. You can get 7 1s, a million 1s or whatever number of 1s you want.
 
Last edited:

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
14,455
Helped
4,745
Reputation
9,505
Reaction score
4,519
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
123,287
I overlooked the obvious and yes @lostinxlation you are correct. I assumed the question referred to two 4-bit numbers and an 8-bit answer. The size of the result wasn't specified, your answer is correct for a 4-bit result. It's an interesting question though, I wonder if there is a mathematical formula for maximizing the number of ones in a number when it is the product of two smaller ones. I'n not sure if it would have a practical application, pehaps in parity generating/checking routines.

Brian.
 

lostinxlation

Advanced Member level 3
Joined
Aug 19, 2010
Messages
701
Helped
197
Reputation
394
Reaction score
184
Trophy points
1,323
Location
San Jose area
Activity points
5,051
your answer is correct for a 4-bit result.
actually, it doesn't matter how many bits the result is expected with. The result of 1111 x 0001 would be full of 1s without 0s regardless of the expected bit width of the result in a certain case. THe problem is OP didn't ask the question properly and both of your answer and my answer are correct, depending on numbering system.

Since I think this is a homework or some assignment, I didn't elaborate it, but I'm sure you understand what I mean by 'numbering system'.
 
Last edited:

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
47,658
Helped
14,075
Reputation
28,407
Reaction score
12,742
Trophy points
1,393
Location
Bochum, Germany
Activity points
276,886
The result of 1111 x 0001 would be full of 1s without 0s regardless of the expected bit width
It seems to me, that signed or unsigned multiply should be specified first.
 

pooja_khubbar

Newbie level 6
Joined
Nov 25, 2010
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,389
thanks all..for the reply..in my case am taking unsigned no.... and its not a homework or assignment..am trying to design some multipliers and then i ve to evaluate the performance of dyanmic ckt..and am using simple binary no.s
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top