Gate diagram in Simulink

2 views (last 30 days)
John Barton
John Barton on 5 Jun 2023
Answered: Bhanu Prakash on 19 Jul 2024
I'm trying to make the following diagram in the simulink but there are some problems I encountered.
1) You can't have a line to somewhere when not connected
2) There are no logical buffers from what I've searched
3) don't know how to merge 2 lines together
If you know how to do this I would appreciate the help.

Answers (1)

Bhanu Prakash
Bhanu Prakash on 19 Jul 2024
Hi John,
Please find below the workaround for the questions asked:
1. Unconnected lines
Yes, you can't have a line unconnected in Simulink. To work around this issue, there are several blocks in Simulink that you can use based on your use case::
  • To pass the inputs (A0, A1, A2, C, D, E) to the design/model, you can either use a 'Constant' block or a 'From Workspace' block (if you want to pass the inputs from the MATLAB workspace).
  • The output 'Q7' can be connected to a 'Display' block (to display the value), a 'To Workspace' block (to store its value in the MATLAB workspace), or a 'Terminator' block (to terminate any unconnected output port).
2. Logical buffers
To replicate the functionality of a digital buffer, you can either use the 'Unit Delay' or the 'Memory' block in Simulink, depending on your use case.
3. Merge two lines
In Simulink, you can merge two wires only when the first wire is properly connected between two blocks. To merge two wires, you need to first connect two blocks with wire-1, place a third block to which wire-2 needs to be connected, and then connect the two wires.
You can refer to the following image to merge two wires:
For further information regarding the blocks mentioned, you can refer to the following documentation links:
Apart from these Simulink blocks, there are several others that you can use. You can search and use the required blocks from the following list:
Hope this helps!

Categories

Find more on Simulink Functions in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!