Uses of logic functions?

  • Minishooz
    13th Apr 2012 Member 0 Permalink
    I have added the following functions to a computer Im making with someone else. In the ALU, there are the following: Addition, OR, AND, NOT, XOR, NOR, NAND, XNOR. I see uses in the logic gates, but what are they used for in programs?
  • R3APER
    13th Apr 2012 Member 0 Permalink
    Splitting a spark to commence two different functions simultaneously? Honestly I myself don't know either.

    Edit: To Do List; Learn how to make fusion reactors and how to make electronic devices.
  • Minishooz
    13th Apr 2012 Member 0 Permalink
    @R3APER (View Post)
    I meant the uses in programs. Not creations. And btw I do know how to make electronic devices and reactors. But thanks for trying to help :)
  • R3APER
    13th Apr 2012 Member 0 Permalink
    @Minishooz (View Post)
    It sounds like you misunderstood my "To-Do" list, which was describing what I need to improve on.

    Oh, what do you mean by programs? In TPT or IRL?

    (I wasn't trying to come across as a troll, I was just trying to share some of my background knowledge, just to clarify if anyone else thought otherwise.)
  • Minishooz
    13th Apr 2012 Member 0 Permalink
    @R3APER (View Post)
    IRL or in the TPT computers.
  • boxmein
    13th Apr 2012 Former Staff 0 Permalink
    @Minishooz (View Post)
    "if this button and that button are down, then fly upwards" = AND gate
    "if any of the two buttons are pressed, then turn off the light" = OR gate
    "If one, but not two switches are down, then keep the light on" = XOR gate
    "If the lights are not on, then turn on the IR lamps for cameras" = NOT gate.
    "As long as two people don't pull these switches, hold the "SAFE" light on" = NAND gate.
    Some IRL examples.
    >edit: moar
  • Minishooz
    13th Apr 2012 Member 0 Permalink
    @boxmein (View Post)
    Thanks alot. That really helped :D
  • mniip
    13th Apr 2012 Developer 0 Permalink
    If you have some binary number,
    and you need to invert its fourth bit you do number=number XOR 16
    if you need to turn off that bit you do number=number AND 240
    if you need to turn on that bit you do number=number OR 16
  • boxmein
    13th Apr 2012 Former Staff 0 Permalink
    @mniip (View Post)
    Yeah, bitwise operations too.
  • Minishooz
    14th Apr 2012 Member 0 Permalink
    @mniip (View Post)
    Thanks, but my computer can't control the amount of bit, so all logic operations are 6-bit.