Duncan Maidens

Duncan Maidens

Hi. I am one of the team at Raspberry Pi with responsibility for content across A level and GCSE materials for Computer Science.

My main area of specialisation is computer networking and security

Location Shropshire UK


  • As you will discover, the added is the heart of the ALU - the arithmetic logic unit which is the core component of a CPU.

  • Ah . Yes . But here we are looking into how the adder is built internally.

  • Did you get the binary addition in the earlier step?
    When you were adding two bits in a column, there were 4 possibilities
    0 + 0 = 0
    0 + 1 = 1
    1 + 0 = 1
    1 + 1 = 0 and 1 to carry.
    The logic circuit above has just built this and it is called a half adder.

  • looks good

  • roll back we are not on hex yet :-)

  • If you write out the truth table for the three inputs you should have 8 possible states that start from 000 and end up with 111.
    Look to any input condition (such as 000) and make the output a 1 (or 0) . Then look at all the other input states where only 1 bit has changed. (001, 010 and 100). They need the opposite output state from 000.

  • Duncan Maidens made a comment

    For those examples with 2 inputs there are 4 possible input states. ((A= 0,B=0) or (A= 0,B=1) or (A= 1,B=0) or (A= 1,B=1)).
    Where there are 3 inputs, there are 8 possible input states.

  • We have shown the construction for each of the gates from NAND gates, because a NAND gate is one of the simplest gates to build from transistors. So NAND gates are the building blocks of all other gates. So to actually make an AND gate we use 3 NAND gates.

  • Very interesting. Not come across that before. I can see how this could look like binary with 'no counter' being a 0 and 'a counter being a '1'. The column headings (representing the 4 squares) would be 4,3,2 and 1.

  • Hi. It's great to have you on the course no matter what the reason. All you need is an interest and a willingness to learn.

  • Great to hear. With those combined skills you should be spotting many cross overs between maths and CS, and certainly where the power of computing, such as running simulations, can really help in understanding maths.

  • Great. Clearly, computing plays an important part in many other disciplines, so understanding computing and how it relates to say, industrial control processes in Chemical engineering, will be most useful.

  • The course is free. You only pay if you want a certificate or want access beyond the end of the course dates.

  • @SamanthaAdams See my example in the reply above to Denise. Does that help ?

  • Denise. You are correct. the only difference is in binary the column headings are 1,2,4,8,16 ... rather than 1,10,100,1000,.. etc. The process is just the same
    Take the number in the column and multiply it by the column heading. Add up for all values
    1101 is 1 in the 8's; 1 in the 4s; 0 in the 2's and 1 in the 1's
    (1 * 8) + (1 * 4) +(0 * 2) +(1 * 1)...

  • It's just an intermediate stage. In this simple example, we have not flagged up when you would 'read' the values as the machine's output.

  • Hopefully, you have engaged with the NCCE as there are tons more resources there to support you.

  • Great. Welcome. This course will be a great start and hopefully, you will follow on with more of our courses which build up over time to a deeper understanding of CS.

  • Sorry for my ignorance. What is SGB ?

  • I can see how with 3 bits you would think it would cont to 7. However, follow the program to see what happens after 010.

  • To add to Fergus's comments above. The animation is on a loop. Hence when it gets to the blank instruction and halts, the animation starts again from the start.

  • and process ?

  • Base 8 is not so widely used directly. Base 16 (Hex) is covered in other courses.

  • This would be a great activity. Traffic lights/ pelican crossings, smart bus signs, most tills in shops, parking pay machines etc

  • Wow. Love the mix of courses.

  • Hi Sinead. All of the resources mentioned above are free to teachers where ever you are and support many aspects of teaching CS. If you are from a state-funded school in England there are also many face-to-face courses available and further support from the National Centre for Computing Education via the teach computing website. https://teachcomputing.org/

  • Hi All. I am Duncan and work for Raspberry Pi and will be one of the facilitators for this course. I have worked as an engineer, software developer and educator in many roles over the last 35 years, mainly specialising in communications and networking, which at every point has needed an increasing understanding of Computers and computing. Looking forward...

  • Hi Erick. Alas, we don't speak Spanish, but other participants on the course may and they may respond to your comments so keep them coming.

  • Hi Juin . We have included a new section in the topic to suggest ways to share a file (See above). Thanks for asking this and helping us improve the courses. :-)

  • Excellent. Can you add to it to feedback as to how many tries it took the user when they get it correct?

  • Excellent

  • Excellent. - Well done. Not quite sure on the logic of needing sufficient funds in both the bank account and (savings or cheque ) account but that is a minor detail.

  • Ah. Yes now I see what you are saying. Yes in this case we can simplify the circuit above by feeding A & B into an AND gate and then inverting the output. (Thus doing away with the second AND gate).
    Often the logic comes about from the way we think about the conditions. We then draw it out and look for ways to simplify it. We also do this using Boolean logic.

  • All. Welcome to week two. If you have not yet added any comments, don't be shy. Share your thoughts, observation and/or questions here at the end of each step. See what your fellow learners post and engage with them.
    It ramps up a bit in this week so stick with it and you should experience the joy of writing some code.
    If any of it is not making sense,...

  • Pastebin should let you display the text with the correct indentation in file from the python editor. Just copy and paste it into 'Pastebin' then go to share the link via twitter. Just copy the link from the post before you delete it . (Unless you want to tweet about it :-) )


  • I recall playing with this some time ago. Yes, great idea to engage kids with. I found this tutorial on it here.

  • I admire your perseverance with a text editor :-) Looks good.

  • Share your thoughts here because I can't see how. A NOT gate has only one input where as an AND gate has at least 2.

  • Welcome. Yes, i too love those escape room puzzles. Lots of ideas here in logic.

  • Did you convert the binary numbers to decimal as well (mentioned half way through the article)?

  • What about 255 and 256 ? Can you see how, for numbers like; 3, 7, 15, 31, 63, 127 and 255 we can easily convert to binary without adding up the value of each individual digit ?

  • If you look at the diagram and work through it you will see you can put as many cross-over switches together as you want to create a 4,5,.... way switching system for really tall buildings.
    The fun them comes in swapping them to the pneumatic time switches that you press to switch on the light, and they pop out (after a delay) to switch the lights off. ...

  • @DavidWebb Hi. One of the switches will be a special switch for just such purposes called a cross-over switch. See https://www.lightwiring.co.uk/tag/3-way-lighting-circuit/

  • If it has just two stops then YES it could be used to think on the logic states. The top position could be a logic 1 and the lower position a logic 0. We could then say we need to send the lift up when 'the call button on the top floor is pressed' AND 'the lift is on the bottom floor'
    We could all say. 'when the call button has been pressed' AND ' the lift...

  • If all the jargon around Python is not making any sense, don't panic.
    Python is a computer programming language like many others you may have heard of (c, C++, c#, java, basic, pascal, Fortran, to name but a few.). On a desktop computer, we need a program that will allow us to write our programs (a text editor) and the 'run' or 'execute' the program. ...

  • The trick for combinational logic truth tables is to create a column for each of the individual outputs with the circuit (like the point labelled X). Then ignore the bigger picture and just concentrate on the one single gate for which you know the inputs and go through them step by step.
    I tend to use this approach.
    If it is an AND gate I am looking for...

  • Yes. In reality, we can have AND gates with multiple inputs, and only when all the inputs are a logic 1, will the output be a logic 1. We can also build this by cascading together multiple 2 input AND gates.

  • 2 way lights are an interesting example, but the problem is there is no 'on' or 'off' position for each switch. A more logical example would be a table lamp (with it's own switch), plugged into a switched socket. What do you need to do to get the light on?
    Extending this logic you can think of a device that has battery back up as well as mains power. What...

  • it is a good way to start to think of logic in terms of on and off. We often draw a digital signal as 0 and 5 volts to represent 0s and 1s, so again this view helps.

  • Sounds really interesting. I love logic problems. Made me think of this one https://www.transum.org/Maths/Puzzles/Scouts/River/
    Also, have you seen the Bebras site ?

  • Hi. I am Duncan Maidens and one of the educators here at RPF. I have been teaching at a variety of places since my mid-20s, so coming up on 30 years of experience.
    I hope you enjoy the course and I, or your peers will answer any questions posed in the comments sections. I will be facilitating this course over the first 3 weeks of May.

  • Captcha can't stop DDoS because the website being attached will still have to deal with the user's first connection (pre captcha)

  • Blocking the user (via their IP address) is OK for a DoS attack, but with a DDoS attack there are so many 'users' possibly coming from different sources it is much more difficult to block, whilst allowing legitimate traffic.

  • If you can please share details of your exercise here.

  • Generally, DNS updates don't use bots but are pushed out by DNS authorities into the hierarchy of DNS servers.

  • As a general rule only allow alphanumeric chars for database queries. Where you have passwords that may contain lots of different characters, hash them before sending which you can ensue are only alphanumeric.
    Different database back ends use different commands so there may be specific combinations that you just simply do not allow.

  • Malware bytes has its own website so if you want it download it from there. As a general rule I would expect to pay for such protection, but there are some good free solutions out there.

  • Interesting article. You can see how the early primitive version of this was store reward cards where they could build a profile of the areas you visited in a large supermarket from your purchase history.

  • Hi Phil. Are you doing this as part of the Secondary Certificate (formally the CSA Programme) ?

  • Hi Holly. Great to see this course being used so far away from the UK. Hope you make use of the other course we offer for Computer Science teachers on Future Learn and other resources on teachcomputing.org

  • Hi Rute. Alas, we don't have any Portuguese speakers as facilitators, so I will only be able to reply if you post your comments in English. However other fellow learners may respond.

  • If it is too good to be true it is probably not true

  • You have brought up two things here. One is Password Generator Programs which can produce random passwords with varying characteristics such as easy to read, length, upper, lower, numbers, symbols etc. They are excellent to make a password.
    Related and often combined with the generators, they are web sites called Password managers, which 'store' all your...

  • @TiinaB Hi Tima Very impressed with you using your time to get up to speed on such things. The ideas of Cyber need to be taught from an early age as technology becomes more accessible to younger and younger audiences. It is so important that we start to understand the technological world in which we live from an early age so that we can be curious and...

  • @timbloore Great to have you onboard and hearing you are just interested. Who knows where this newfound knowledge may take you.

  • Welcome, Duc. Great to have participants from all over the world

  • Hi Geraldine. Are you doing this as part of the Secondary Certificate (formally the CSA Programme) ?

  • Hi. I am Duncan Maidens, one of the educators from the Raspberry Pi Foundation(RPF).

    I taught Computer Networking and Cyber Security in Higher Education for 20 years before joining RPF and now support a number of programmes here.

    I will be your facilitator for the course for the next 3 weeks so will pop in and out of the discussions after each step. ...

  • Diane and I (as your facilitators) will be available from 1 Feb to 19th Feb to answer any questions you have. After that, you will have a varying period of ongoing access to the course depending on your status (such as if you have come via the NCCE (teachcomputing). You will still be able to post comments and your peer learners may reply.

  • Minor point. Packet switching is actually Layer 3 and is done by routers as they examine the IP destination address and decide where to send the packets next.
    Layer 2 are switches and they switch Ethernet frames using the mac addresses.
    You can see frustratingly the terminology seems to be inconsistent. Packet 'switching' (Layer 3) when 'switches' are Layer...

  • Seen my comment below. You won't get a message to say something went wrong.

  • I created some animations in scratch some time ago https://scratch.mit.edu/studios/4481164/

  • Not quite. When a new device is plugged into a switch, the switch learns the MAC address of the device by looking at the source address of the first frame it receives from the device..

  • It does not really stop and start when required. With Ethernet, you just try and send if the connection line is free and hope it gets through.

  • @KhaledAlarnouty We aimed it at computer science teachers to 'upskill ' their subject knowledge. Hence it teaches you all about the subject in a way, that if you are a teacher, you would be able to use with your students.
    However, we know that many people who are not teachers complete the course just to learn about the subject.

  • We aimed it at computer science teachers to 'upskill ' their subject knowledge. Hence it teaches you all about the subject in a way, that if you are a teacher, you would be able to use with your students.
    However, we know that many people who are not teachers complete the course just to learn about the subject.

  • see note above

  • see note above

  • With IP, each fragment may take a different path through the network (it is a connectionless service). Which router would reassemble the fragmented IP packet ?

  • See explanation below. It is actually 254 and one of these will be needed for the router.

  • Re the article you posted. It did say 'some ISP are stockpiling IPv4 addresses'
    Basically if you were early into the IP game you could have been allocated a class B address or even a whole Class A address. If you have not used them all in your networks, it is really difficult to 'give them back' for other to uses. The whole internet is built on the first...

  • Alas we don't go into subnet detail at this level.
    All devices on an IP network have at least one IP address (a client device, a printer etc). (NOTE. Your device may have two IP addresses if it has more than one connection. (E.g If you have plugged in your laptop to a network connection and left the wireless on, each connection will have it's own IP...

  • Alas we can't reply because we do not know which part of the frame was corrupted . It could have been in the source address. Thus we have no way at this level of contacting the source device.

    What if there was only one place to go ? A dedicated point to point link ?

  • Hi. You are mixing terminology here. Your home connection (between you and your ISP) is technically part of a WAN. Thus the ISP's WAN includes all of it's customers routers and the connections back to some central core device, covering a geographical area. In contrast, everything connected to your router in your home is part of your LAN. ADSL is a...

  • Well... your old modem will be redundant but you will need a new modem to convert the signals coming in on the fibre to the electrical signal in your router. If your router has the fibre connector on to, then this modem functionality will be built into your router, in the same way ADSL modems are built into ADSL routers (routers with a telephone RJ11 jack to...

  • Actually the switch functions from the start immediately a device is plugged in. The only thing it does sub-optimally is sending a frame to the new device before it has learnt its mac address. In this case, the switch defaults to the behaviour of a hub and broadcasts the frame to all ports. That way the correct device gets it and the other all ignore it. ...

  • Good answer except it is not a special signal sent by the device. It just sends its first ethernet frame as it wants to start to communicate. The switch looks at the source address in the frame and thus learns the address of the device attached to that port on which the frame was recieved.

  • The point you made in your first part to the answer is correct for any transmission system. The signal starts out at the transmission end at its strongest and over distance becomes weaker and weaker. By the time it arrives at the receiving end it is at its weakest. At this point (i.e within a connector) it is often physically next to the media that sends the...