Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. quine mccluskey method on C/C++

quine mccluskey method on C/C++

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++algorithms
11 Posts 4 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Reuben Cabrera

    hey guys, can I ask for help. can you guys help me with the algorithm/code for quine mccluskey method on C/C++. i kinda having trouble with the algorithm and I need to provide the code on Oct 9 for my CS class. please do help me with my machine problem :) thank you and God bless. :D

    D Offline
    D Offline
    David Crow
    wrote on last edited by
    #2

    Reuben Cabrera wrote:

    i kinda having trouble with the algorithm...

    And that trouble would be?

    Reuben Cabrera wrote:

    please do help me with my machine problem :)

    Help is a two way street. What have you done thus far?

    "One man's wage rise is another man's price increase." - Harold Wilson

    "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

    "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

    R 2 Replies Last reply
    0
    • R Reuben Cabrera

      hey guys, can I ask for help. can you guys help me with the algorithm/code for quine mccluskey method on C/C++. i kinda having trouble with the algorithm and I need to provide the code on Oct 9 for my CS class. please do help me with my machine problem :) thank you and God bless. :D

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #3

      Reuben Cabrera wrote:

      I need to provide the code on Oct 9 for my CS class.

      And you think submitting someone else's code and claiming it as your own is a good idea?

      CPalliniC R 2 Replies Last reply
      0
      • L Lost User

        Reuben Cabrera wrote:

        I need to provide the code on Oct 9 for my CS class.

        And you think submitting someone else's code and claiming it as your own is a good idea?

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #4

        Dear, you are sooooooooooooo old school...

        THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite

        In testa che avete, signor di Ceprano?

        L R 2 Replies Last reply
        0
        • CPalliniC CPallini

          Dear, you are sooooooooooooo old school...

          THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #5

          Oh you. :-O

          1 Reply Last reply
          0
          • L Lost User

            Reuben Cabrera wrote:

            I need to provide the code on Oct 9 for my CS class.

            And you think submitting someone else's code and claiming it as your own is a good idea?

            R Offline
            R Offline
            Reuben Cabrera
            wrote on last edited by
            #6

            im not submitting someone else's code. i just need help. that's all.

            L 1 Reply Last reply
            0
            • D David Crow

              Reuben Cabrera wrote:

              i kinda having trouble with the algorithm...

              And that trouble would be?

              Reuben Cabrera wrote:

              please do help me with my machine problem :)

              Help is a two way street. What have you done thus far?

              "One man's wage rise is another man's price increase." - Harold Wilson

              "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

              "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

              R Offline
              R Offline
              Reuben Cabrera
              wrote on last edited by
              #7

              im already at converting the decimal # to binary. but the problem is the output should be like as a whole. i saw other programs converting decimal to binary and they just printed the remainder in reverse. my plan is to multiply the first digit to 10^0 then the next is by powers of 10 so when I add it i will have a whole number.

              1 Reply Last reply
              0
              • CPalliniC CPallini

                Dear, you are sooooooooooooo old school...

                THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite

                R Offline
                R Offline
                Reuben Cabrera
                wrote on last edited by
                #8

                #include<stdio.h>
                #include<stdlib.h>
                #include<conio.h>

                int convert(int);
                main()
                {
                int var,x,y,number,number2;
                int minterms[x],minterm[y];

                printf("=========QUINE MCCLUSKEY METHOD========");
                printf("\nHOW MANY VARIABLES DOES THE FUNCTION HAVE:?");
                scanf("%d",&var);

                printf("\nHOW MANY MINTERMS?:");
                scanf("%d",&number);
                number2=number;
                for(x=0;number2!=0;number2--)
                {
                printf("\nENTER MINTERM:");
                scanf("%d",&minterms[x]);
                x++;
                }

                //convert each minterm to there binary form//
                x=0;
                y=0;
                while(number!=0)
                {
                minterm[y]=convert(minterm[x]);
                x++;
                y++;
                }

                y=0;
                while(number!=0)
                {
                printf("\n %d",minterm[y]);
                number--;
                y++;
                }

                }

                int convert(int a)
                {
                int quot,binarynumber[100],i=1,sum=0;
                int multi;
                quot=a;
                while(quot!=0)
                {
                binarynumber[i++]=quot%2;
                quot= quot/2;
                if(i==1)
                {
                sum=sum + (binarynumber[i++] * 1);
                }
                else

                sum = sum + (binarynumber\[i++\] \* multiplier);
                }
                
                return sum;
                

                }

                1 Reply Last reply
                0
                • D David Crow

                  Reuben Cabrera wrote:

                  i kinda having trouble with the algorithm...

                  And that trouble would be?

                  Reuben Cabrera wrote:

                  please do help me with my machine problem :)

                  Help is a two way street. What have you done thus far?

                  "One man's wage rise is another man's price increase." - Harold Wilson

                  "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                  "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

                  R Offline
                  R Offline
                  Reuben Cabrera
                  wrote on last edited by
                  #9

                  and quine mccluskey method would require grouping the minterms according to the # of 1's in their binary form. how do you do that? then printing the final output as wxyz w'x' etc.

                  1 Reply Last reply
                  0
                  • R Reuben Cabrera

                    im not submitting someone else's code. i just need help. that's all.

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #10

                    Then you need to explain clearly what help; we cannot guess.

                    R 1 Reply Last reply
                    0
                    • L Lost User

                      Then you need to explain clearly what help; we cannot guess.

                      R Offline
                      R Offline
                      Reuben Cabrera
                      wrote on last edited by
                      #11

                      ok. so the binary form is stored in the string. and the i will make a for loop that will count the number of 1's in the binary form of each entered minterms. my problems is how do I group together the minterms with the same number of 1's cause i need to compare 2 different groups later.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups