Close

Results 1 to 8 of 8
  1. #1
    DF Wh0re grover2000's Avatar
    Join Date
    Oct 2000
    Posts
    134
    Thanks
    18
    Thanked:        1
    Karma Level
    0

    Help Theory of logic gates and how they work

    Can anyone explain how logic gates are used in a computer?

    I understand how logic gates work, but cant relate it to how they work on a computer for example when the key is pressed how a computer would process that key press into an output on the screen using logic gates.

    Any help is greatly appreciated.

    Grover

  2. #2
    DF Super Moderator Teajunkie's Avatar
    Join Date
    Dec 2009
    Location
    Devon
    Posts
    3,818
    Thanks
    1,670
    Thanked:        1,644
    Karma Level
    498

    Default Re: Theory of logic gates and how they work

    Magic!

    boolean logic. but what you should be asking is how does a CPU turn a key press into data or how does a CPU work!
    Last edited by Teajunkie; 15th November 2014 at 12:57 PM.
    Find me on Instagram and twitter @mrteajunke.

    Thanks to Teajunkie

    Over Carl (15th November 2014) 


  3. #3
    DF Wh0re grover2000's Avatar
    Join Date
    Oct 2000
    Posts
    134
    Thanks
    18
    Thanked:        1
    Karma Level
    0

    Default Re: Theory of logic gates and how they work

    Thank you for the correction, but is it possible for anyone to answer the modified suggested question or direct me to a resource?

    thanks in advance

    grover

  4. #4
    DF Jedi doughboy's Avatar
    Join Date
    Jul 2001
    Location
    Beckenham
    Posts
    2,142
    Thanks
    139
    Thanked:        90
    Karma Level
    346

    Default Re: Theory of logic gates and how they work

    Google for alu basics. ALU is the arithmetic logic unit, and iirc it was the first thing we learnt about in digital engineering.

    Thanks to doughboy

    grover2000 (16th November 2014) 


  5. #5
    DF Jedi blacksheep's Avatar
    Join Date
    Jun 2006
    Location
    Manchester
    Posts
    3,877
    Thanks
    87
    Thanked:        265
    Karma Level
    489

    Default Re: Theory of logic gates and how they work

    Operating system does most of that, the cpu (and this is just a random guess without checking anything) would be assembly so basically that can only move data, and/or/not etc so you'll have the inputs from the keyboard get an ascii value which is displayed.

    Thanks to blacksheep

    grover2000 (18th November 2014) 


  6. #6
    DF PwNagE dpSparhawk's Avatar
    Join Date
    Oct 2006
    Location
    Liverpool
    Posts
    6,873
    Thanks
    1,716
    Thanked:        2,393
    Karma Level
    775

    Default Re: Theory of logic gates and how they work

    [Only registered and activated users can see links. ]

    Thanks to dpSparhawk

    grover2000 (22nd November 2014) 


  7. #7
    DF PwNagE dpSparhawk's Avatar
    Join Date
    Oct 2006
    Location
    Liverpool
    Posts
    6,873
    Thanks
    1,716
    Thanked:        2,393
    Karma Level
    775

    Default Re: Theory of logic gates and how they work

    Plus some possible help on Logic Gates... [Only registered and activated users can see links. ]

    Thanks to dpSparhawk

    grover2000 (22nd November 2014) 


  8. #8
    Banned eXOBeX's Avatar
    Join Date
    Oct 2011
    Location
    .
    Posts
    21
    Thanks
    5
    Thanked:        4
    Karma Level
    85

    Default Re: Theory of logic gates and how they work

    It's a tricky one to look at as one big "thing", it might help to break it into layers. "Top down design" is something I learned in college, and I suppose would sort of apply here as well (although we never had to design a circuit to print "hello world" on a screen, that's taking a BTEC computing course a bit far).

    You've got your high-level programming language that's doing all the "if this key is pressed, print this".

    That's been compiled into low-level machine code (assembly language) which will have a small set of commands that deal with things in much smaller steps. In this case wait until a key's pressed, grab the key code, print it (if it's printable) and wait for the key to be let go of before repeating the process:-
    Set data register 1 to address of start of display memory
    Rdkeystatus: Read data from keyboard status port into data register 2
    Compare data register 2 with xxx, where xxx has flags indicating key up, key down, etc. and jump to Rdkey if key down
    jump to Rdkeystatus
    rdkey: read data from keyboard data port into data register 2
    jump to WaitForLetGo if data register 2 less than 32 (in other words an unprintable character)
    copy data register 2 to address held in data register 1
    increment data register 1
    WaitForLetGo: Rdkeystatus: Read data from keyboard status port into data register 2
    Compare data register 2 with xxx, where xxx has flags indicating key up, key down, etc. and jump to WaitForLetGo if key down
    jump to Rdkeystatus
    That's very simplistic and doesn't deal with what happens when you run out of screen, but hopefully you get the picture.

    Now you get the nuts and bolts of these individual commands. If the processor receives an instruction code, depending on what the code is will depend on whether the processor needs to fetch the next one or two codes (containing the stuff it needs to work with, numbers to add for example) and what to do with it. That'll be microcode (Wikipedia has articles on it) that I know nothing about, that's what processor designers are for

    The next layer down from microcode will be the logic gates themselves, and below that the transistors that make up those gates.

    Thanks to eXOBeX

    grover2000 (5th December 2014) 


Similar Threads

  1. Ps3 with No Blu-Ray, No Logic Board
    By AP0ll0UK in forum Sony Consoles
    Replies: 4
    Last Post: 22nd November 2010, 11:26 PM
  2. Driving Theory Training is bad in theory
    By 4me2 in forum Nintendo Consoles
    Replies: 3
    Last Post: 21st March 2008, 10:19 AM
  3. Logic Works
    By Lee Macro in forum The Comedy Club
    Replies: 4
    Last Post: 21st January 2008, 01:07 PM
  4. hillbilly logic!!
    By the_wizzard in forum The Comedy Club
    Replies: 0
    Last Post: 13th December 2003, 02:11 AM

Social Networking Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •