Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How to design a circuit to compare two selected numbers without using memory components (Please...)

Sabrina

New Member
Hi, I came here cause I heard from my friend that here can help me, since there are many experts.. Thanks a lot in advance..

I have to solder it and make it work, but since I don't even know how to design this circuit, I am dying...
If anyone can design this circuit, please help me... I am so desperate ..

<The goal is to Implement a circuit to compare two selected numbers without using memory components such as RAM or ROM.>

Screenshot 2024-05-02 at 01.53.59.png


[Operation Sequence]
  1. Start: Press the Start button to begin. When this button is pressed, the M LED displays 0, and the A and B LEDs remain off. If the "Start" button is pressed during operation, it returns to this state.
  2. Increment M LED Number: Each time the "Input" button is pressed, the M LED number increases. (After 9, it returns to 0). At this point, the A and B LEDs remain off.
  3. Move to Desired Number A: When the desired number is displayed on the M LED, press "Select". The number on the M LED moves to the A LED, and the M LED displays 0 again. If you want to input 0, you can press the "Select" button immediately.
  4. Increment M LED Number Again: Press the "Input" button again, and the M LED number starts increasing as in step 2. There is no change in the number displayed on the A LED, and the B LED remains off.
  5. Move to Desired Number B: When the desired number is entered on the M LED, press "Select". Then, the number on the M LED moves to the B LED, and the M LED turns off (not displaying 0). The A LED should still display the previously selected number. After this point, pressing "Input" should not change the M LED. To display a number on the M LED again, press the "Start" button to restart.
  6. Check Result by Pressing the Result Button: Press the "Result" button to illuminate the LEDs according to the table below. The numbers on the A and B LEDs should remain the same, and the M LED should remain off. Result S1 S0 A=B 1(on) 1 A>B 1 0(off) A<B 0 1 If the "Result" button is pressed before A and B numbers are input, the LEDs should all be off: 0 0 0
  7. Restart: To restart, press "Start". This returns to the state described in step 1.
 
Welcome to ETO!
This is a Homework Help forum, not a homework-done-for-you one. Post your best effort at doing this assignment and we can give guidance where necessary.
 
Addition and subtraction are combinatorial circuits which do not require any memory. They are also trivial circuits.
 
Can you use processors ? Can you code, or does this have to be
a logic gate level design ?

Odd that you cant use memory because you are being asked to do a state
machine design, which requires memory.

Back in the day, in TTL logic, there were comparators, ALUs, adders, flops
(because you are asking for a state machine)....

Regards, Dana.
 
Hi Dana, thanks for the comments I think I have to design with basic logic gates, but I think I am possible to use flip-flop or latches
nt use memory because you are being asked to do a state
machine design, which requires memory.

Back in the day, in TTL logic, there were comparators, ALUs, adders, flops
(because you are asking for a state machine)....
 
Do you have choice of where you get parts and what type ? Are you at the
point of working with FPGA and its tools, or any logic simulator ? Are you
give a board to work with....?

Start at the beginning.

  1. Start: Press the Start button to begin. When this button is pressed, the M LED displays 0, and the A and B LEDs remain off. If the "Start" button is pressed during operation, it returns to this state.
  2. Increment M LED Number: Each time the "Input" button is pressed, the M LED number increases. (After 9, it returns to 0). At this point, the A and B LEDs remain off.
So you need a "input" button, and a counter that counts 0 - 9 whenever you press the input button.
And you need to interface counter to a decoder to drive 7 segment LED display digit.

And you need a "start" button, when pressed, resets counter.

You have to press buttons and they bounce. So debounce them first and then apply to F-F's, counters.
Google "debounce buttons" for methods and why you need to do this.

Break this down into basic pieces, like above, and get each to work.

Steps 3 on you need to choose what is displayed on LED, so something has to hold
LED value, and a method of choosing where it gets its input for display what are those
2 logic elements called ? You mentioned latch earlier, whats the 2'ond one ? In simplest
terms if you had two bits, each one considered a different bit, how would you select one
to pass on to other logic versus the other....? Thern expand design to manage how many
bits have to be handled.


Regards, Dana.
 
Hi Dana, thanks for the comments I think I have to design with basic logic gates, but I think I am possible to use flip-flop or latches
Why would you need flip-flops or latches for a combinatorial circuit? At least for the element that compares two numbers by doing a subtraction. The rest of the sequencing can benefit from flip-flops.
 
Why would you need flip-flops or latches for a combinatorial circuit? At least for the element that compares two numbers by doing a subtraction. The rest of the sequencing can benefit from flip-flops.

Its not purely combinational, post #1 shows number must be held, then transferred and source reset on demand.
So a latch is required to hold the number from the counter. And a state machine sequence, unless sync parts
are used, to reset source.

Unless I am miss reading something here....

Regards, Dana.
 

Latest threads

New Articles From Microcontroller Tips

Back
Top