Close

Results 1 to 8 of 8
  1. #1
    DF VIP Member 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 Admin Teajunkie's Avatar
    Join Date
    Dec 2009
    Location
    Devon
    Posts
    4,227
    Thanks
    1,827
    Thanked:        1,824
    Karma Level
    568

    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.
    Have you joined the DF discord server. https://discord.com/invite/YajVGQxDaw

    Thanks to Teajunkie

    Over Carl (15th November 2014)  


  3. #3
    DF VIP Member 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 VIP Member doughboy's Avatar
    Join Date
    Jul 2001
    Location
    Beckenham
    Posts
    2,142
    Thanks
    139
    Thanked:        90
    Karma Level
    407

    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 VIP Member blacksheep's Avatar
    Join Date
    Jun 2006
    Location
    Manchester
    Posts
    3,877
    Thanks
    87
    Thanked:        265
    Karma Level
    545

    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 VIP Member dpSparhawk's Avatar
    Join Date
    Oct 2006
    Location
    Liverpool
    Posts
    6,873
    Thanks
    1,716
    Thanked:        2,393
    Karma Level
    746

    Default Re: Theory of logic gates and how they work

    Thanks to dpSparhawk

    grover2000 (22nd November 2014)  


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

    Default Re: Theory of logic gates and how they work

    Plus some possible help on Logic Gates... http://www.cambridgegcsecomputing.or...d_section=4037

    Thanks to dpSparhawk

    grover2000 (22nd November 2014)  


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

    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. Prison V Work
    By ibobsy in forum The Comedy Club
    Replies: 6
    Last Post: 22nd November 2004, 12:24 PM
  2. Do them AB TONER belts actually work ??
    By us in forum Health & Fitness
    Replies: 21
    Last Post: 4th November 2002, 02:07 AM
  3. How do i get the Snes emulator to work????
    By sanjuro in forum Microsoft Consoles
    Replies: 5
    Last Post: 5th October 2002, 08:55 PM
  4. Will V5 Laser unit work in any other PS2?
    By Dupster in forum Sony Consoles
    Replies: 13
    Last Post: 13th September 2002, 01:53 PM
  5. cant get vcd to work with remote free dvd dongle
    By darren67 in forum Microsoft Consoles
    Replies: 3
    Last Post: 29th August 2002, 10:25 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
  •