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

[SOLVED] Digital Design Interview Question

Status
Not open for further replies.

mail4idle2

Full Member level 4
Joined
Oct 20, 2012
Messages
200
Helped
20
Reputation
40
Reaction score
19
Trophy points
1,298
Activity points
2,173
I have a block which compares and gives the smaller and Larger number of 2 numbers.
Using above block, when 4 numbers are given as inputs, produce the outputs in ascending order. How ?

Thanks
 

mail4idle2

Full Member level 4
Joined
Oct 20, 2012
Messages
200
Helped
20
Reputation
40
Reaction score
19
Trophy points
1,298
Activity points
2,173
Is my question not clear ?
Please read my question once again.
 

vinoth8051

Full Member level 3
Joined
Dec 21, 2009
Messages
179
Helped
67
Reputation
134
Reaction score
65
Trophy points
1,328
Location
Delhi, Kanpur, Madurai, India
Activity points
2,380
Given:
a block which compares and gives the smaller and Larger number of 2 numbers....
Goal:
when 4 numbers are given as inputs, produce the outputs in ascending order....
Solution:
Assuming the numbers to be sorted are 7,1,3,6

Step 1: Take the first two numbers 7 and 1. Using your so called "block" gives smaller number as 1 and big number as 7. So swap the two numbers we get sequence as 1, 7, 3, 6.

step 2: Now move to numbers 7 and 3, give this as input to your block. big number is 7 and small is 3. So replace the positon of two numbers we get sequence as 1, 3, 7, 6.

step 3: Give the input to the block next two numbers 7 and 6. find which is greater and smaller. swap it to give the output 1,3,6,7.

Output:
Using your block we have sorted the given sequence in ascending order 1, 3, 6,7.
 
  • Like
Reactions: :-)

    :-)

    points: 2
    Helpful Answer Positive Rating

:-)

Junior Member level 1
Joined
May 31, 2012
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Wonder Land Called India
Activity points
1,385
Given:


Goal:

Solution:
Assuming the numbers to be sorted are 7,1,3,6

Step 1: Take the first two numbers 7 and 1. Using your so called "block" gives smaller number as 1 and big number as 7. So swap the two numbers we get sequence as 1, 7, 3, 6.

step 2: Now move to numbers 7 and 3, give this as input to your block. big number is 7 and small is 3. So replace the positon of two numbers we get sequence as 1, 3, 7, 6.

step 3: Give the input to the block next two numbers 7 and 6. find which is greater and smaller. swap it to give the output 1,3,6,7.

Output:
Using your block we have sorted the given sequence in ascending order 1, 3, 6,7.
Thanks for step by step bubble sort example... made it clear.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top