[SOLVED]Algorithm & Flowchart Design

Thread Starter

Pushkar1

Joined Apr 5, 2021
416
Main focus of this thread is to design program flowchart, showing the controls in a program within a embedded system.

But for now I am taking a simple example to add the function in flowchart because I don't have any idea how to show the function in flowchart.

I drawn a programming flowchart that add a two numbers. I want to add function in flowchart that takes a two number and gives results. I will call this function from main function and when that function will execute it will give result


1621423782465.png


@MrChips any suggestions, How do you show a function in flowchart?
 

djsfantasi

Joined Apr 11, 2010
9,156
Main focus of this thread is to design program flowchart, showing the controls in a program within a embedded system.

But for now I am taking a simple example to add the function in flowchart because I don't have any idea how to show the function in flowchart.

I drawn a programming flowchart that add a two numbers. I want to add function in flowchart that takes a two number and gives results. I will call this function from main function and when that function will execute it will give result


View attachment 238981


@MrChips any suggestions, How do you show a function in flowchart?
A rectangle with the vertical bars drawn as a double line. Like this:
AD65D364-A2FD-411D-ABC4-7BB7D0BE6B6D.jpeg
This is the flowchart symbol for a pre-defined process, like a function. Use a recognizable name and label the flowchart for the function with the same name.

In your example, add double lines to the box labeled “ADD”.
 

KeithWalker

Joined Jul 10, 2017
3,063
your function should test the inputs A and B to make sure they are the correct data type and format before trying to add them. If necessary, it should convert them. Adding binary to hex gives funny answers.
 

BobaMosfet

Joined Jul 1, 2009
2,110
Main focus of this thread is to design program flowchart, showing the controls in a program within a embedded system.

But for now I am taking a simple example to add the function in flowchart because I don't have any idea how to show the function in flowchart.

I drawn a programming flowchart that add a two numbers. I want to add function in flowchart that takes a two number and gives results. I will call this function from main function and when that function will execute it will give result


View attachment 238981


@MrChips any suggestions, How do you show a function in flowchart?
I'm really proud of you for giving it a go. Most people won't. You can use this free online tool for flowcharting:

https://app.diagrams.net/

You use this box to show a function or process (something more complex than a statement):

1621439986187.png


Start & Exit Boxes look like this:

1621440068798.png

On-page connectors look like this (circle with 'A' in it):

1621440202125.png

On-Page and Off-Page connectors, if your flowchart spans to multiple pages:

1621440327142.png

and so forth...
 

MrSalts

Joined Apr 2, 2020
2,767
Check out Nassi–Shneiderman diagrams
It is a much more compact method, more readable once you get used to it. There are formats for while loops, iterations and the triangles are if/then/else or switch-case decision points.

and, the best part (for me), is no significant memorization of icons. Still, it's memorization for a beginner but since it makes so much sense to me, I really didn't feel like I was memorizing anything.
1621447915028.png
 
Last edited:

Ya’akov

Joined Jan 27, 2019
9,070
Not to cause confusion, but...

When flow charts become insufficient (for example, in the case of blocking processes and multitasking), some subset of UML (Unified Modeling Language) can really save the day. UML is big but you don't have to make a career out of it. It offers a way to show logic that isn't simple decisions and for other sorts of operations that traditional flowcharting can't represent.

I found it exceptionally useful in systems design, particularly where multiple, independent, and mutually exclusive processes had to be shown.
 

Thread Starter

Pushkar1

Joined Apr 5, 2021
416
I'm working on the flowchart to make a list with using Array.

List program must meet three requirements as below.

  1. Add element into list
  2. Find element into list
  3. Remove an element from list.

When I think like my flowchart is working logically, I will post it.

I've some problem with flowchart for list. I'm trying to solve problems
 

MrChips

Joined Oct 2, 2009
30,711
I'm working on the flowchart to make a list with using Array.

List program must meet three requirements as below.

  1. Add element into list
  2. Find element into list
  3. Remove an element from list.

When I think like my flowchart is working logically, I will post it.

I've some problem with flowchart for list. I'm trying to solve problems
These require three different algorithms. Draw three separate flowcharts.
 

Thread Starter

Pushkar1

Joined Apr 5, 2021
416
These require three different algorithms. Draw three separate flowcharts.
I'm a bit late to look your comment @MrChips I have drawn a flowchart.

I believe logically my flow chart does below tasks
  1. It can only add and print element in list.
  2. It can also detect if the number 5 present in a list.

Is this flowchart doing both tasks ?

Mrchip1.jpg
 
Last edited:

click_here

Joined Sep 22, 2020
548
I'm a bit late to look your comment @MrChips I have drawn a flowchart.

I believe logically my flow chart does below tasks
  1. It can only add and print element in list.
  2. It can also detect if the number 5 present in a list.

Is this flowchart doing both tasks ?

View attachment 239816
You need to start at i=0 and test until i<N, or start at 1 and test until i<=N

You set number=5, but then overwrite that value 2 blocks down
 
Top