Digital Circuits Half/Full Adders - hardware

I am taking a Digital Circuits class in which we do not use a book, only lecture notes. In the section that covers adders I only have 2 small examples covering addition and subtraction of binary numbers. I am pretty sure i am going to have worded problems in the exam such as design a circuit to count something etc. Does anyone know any sites that have example questions and solution for me to go over?

I don't know of any particular sites, but I do know that when I took a similar class, the lecturer was awful and I relied entirely on the textbook. It was Digital Design, by M Morris Mano. I highly recommend it - it's got plenty of problems to go over and has all the information you need in case you get stuck on something.

Wikipedia is a useful resource. The best way to learn electronics is to build your own circuits, preferably with real hardware or using a simulator if the former is not practicable.
P.S. You do not need adders to count events. A cascade of bi-stable flip-flops will do this.

Related

Information about Evolutionary Art

I have begun to do some research about Evolutionary Art algorithm. I read a lot of documents about it. But it seems not easy to understand.
The website http://picbreeder.com is a great example for this. But I don't need this in the beginning because it is too complex.
Where can I find some simple code about this in Java? I think read code could help me much.
Thanks!!!
"Evolutionary Design by Computers" By David Bentley (amazon) has a couple of chapters on evolutionary art. However i dont think it includes any code / pseudocode. The canonical GA should do all you need, however the termination condition could be tricky as art is a subjective subject. (Not objective and therefore enumerable)
Hope this helps...
It looks like the EJC library might help you out, and it looks like a number of open source projects/tools come up if you Google for "java evolutionary computing."
I don't know how simple it is, and believe me it needs to be cleaned up a bit, but I have something that might get you started at https://github.com/murmux/Evo/tree/master/assignment2c It doesn't deal with art, rather game theory, but you can use it under the terms of the GPLv3 if you'd like. That uses Genetic Programming... I have another example using a more vanilla EA I might put up later.
Instead of evolving programs to play "Iterated Prisoner's Dilemma," you would evolve programs to generate an art work. The fun part is coming up with a way to "score" an image for its fitness. (Although Picbreeder seems to skip scoring by having you pick the mating pool directly...)
Check this app: EvoPic, its An evolutionary picture creator that uses Steady-State Genetic Algorithm, to produce evolutionary pictures by drawing uni-code characters in a picture box.
Example:

OOD / OOP Etudes / Code exercises

I've been searching the web for some time now. I am looking for small sample exercises for OOD practice (& for some internal TDD workshops).
If there is one single place, where this need is being served, please point me to it.. and close this question
Constraints:
Language-agnostic real world problem
Small : Something that takes an hour to two at max to solve (or has sub-parts that can fit this constraint).
Not Algorithm centred : Not be focussed on just solving a computational task. (There are multiple sites that serve this category.) Involve > 2 interacting entities.
Solved by multiple people, preferably yourself : Goodness verified. Links preferred. Please do not post something that may be a good exercise... subjective
Similar SO question 60109, but the answers dont meet my need here. I found that I've lost my touch (was thrashing ideas) with OOD after prolonged exposure to a day-job. Need to get it back..
Update: Are we collectively out of short OOP exercises ? I was hoping that I'd have a bunch to pick from. However my web-searches (this is a diff exercise in formulating the right search string) and the lack of responses here seem to indicate otherwise. Maybe I posted to SO at a bad time.. in which case bumping this thread for more responses.
http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata
http://schuchert.wikispaces.com/Monopoly%28r%29
Jeff Bay's Object Calisthenics. Following these will improve your OO skills.
Bill Wake's spreadsheet TDD challenge
Dave Thomas' CodeKata
Kindness,
Dan
From the AGPPnP book by Robert Martin aka UncleBob
CoffeeMaker Mark IV - Page 2 has the problem statement
Questionnaire Practice Problem
A problem I've worked on in a couple of different jobs is that of writing some generic, data-driven survey/questionnaire functionality. It's not majorly complex, but has enough interesting avenues to be a good OOD practice problem I think. It's definitely real-world and crops up in a lot of places.
You can start off thinking about how to structure a Survey. It is obviously made up of Questions, but do you also want Categories? Can a Question have subquestions? Can a subquestion have subquestions? How deep can you go?
A question probably needs to have potential Scores. What types of scores can you have? What types of questions can you have (multiple choice, multiple answer, freetext, etc.)?
Once you've got the basic business logic, you can also think about how you display a survey . Maybe you have a SurveyRenderer and a QuestionRenderer? How do you decide how to render different types of questions? (Maybe you use a Strategy pattern... as in this SO question.) How do you render a read-only version of the survey?
You can also think about persistence. How do you record responses to a blank questionnaire? How does your object graph of a survey get mapped into a database (or some other backing store), and vice versa?

Circuit Design book for programmers

I need a book that teaches circuit design that will be useful when programming microcontrollers. Usually when I join a project, before I can start programming any logic into the microcontroller, it needs to be integrated into a circuit with a power supply, transducer, etc. I find that I'm lacking the skills to do this myself but once the circuit is set up and someone shows me where the Vcc and gnd wires go, I can usually program the controller fine myself.
So I need a book that is geared towards programmers but will be useful when I need to setup a circuit. I'm not looking for a theoretical textbook that will teach Ohm's law and Kirchoff's law since I already have a few of those. I'm looking for something more like a reference guide or a cookbook. Something that will show me when a voltage divider will be useful or how to pick different valued components.
I hope this question wasn't too hardware oriented and although it's not about programming, it is about the things I need to do before I can program.
Any suggestions?
Can I suggest you need "The Art of Electronics" by Paul Horowitz and Winfield Hill. This is a pretty standard textbook and should be easy enough to get hold of. It contains some theory but lots of practical electronics including examples of good and bad circuit. Even more practical are some very thin books produced by Radio Shack called the "Engineer's Mini-Notebook" series. I have had a collection of those for over 20 years and still need them every month or so.
All the best
Ian
I don't know about other microcontrollers but AVR has a nice introductory Application Note:
http://www.atmel.com/dyn/resources/prod_documents/doc2521.pdf
It goes over how you should connect the power supply, reset lines, etc. It may not be complete but I find it has a few good tips for any microcontroller, but specifically AVR. Look for other such application notes from your vendor.

Do you think you need some simple tutorials on Microcontroller programming?

This is not 100% programming related. But I think this is somewhat useful because it is addressing a minority in the SO community.
Microcontroller programming is one of the interesting areas in programming. I saw some topic here requesting the Resources for starting / learning / discussing about PICs.
Example topic
Since I have plenty of knowledge and experiences in this area I am thinking of publishing some resources that helps a novice to learn them from the basics. It will be not just a theoretical publication and will be based on example projects. I hope to start this over a new blog + forum so the users can dynamically interact with each other. I came in to this decision because I found very small amount of Sites that a novice can start learning and work collaboratively.
What do you guys think about this? Have you ever experienced such difficulty? Do you think you can get some use of that? What are the things you like to see on the site?
I would be thankful If you are not going to close this as NPR. I just want to do some service to other microcontroller lovers :)
There are already a few such tutorials on the net (e.g. this one from SparkFun), another one might be a valuable addition, but only if it is better or different in some way.
What will you offer that is a real improvement?
Some suggestions:
Don't assume I have windows
Have some side discussion of difference between various MCU and/or supporting electronics. Discuss some of the trade offs
You'll need a pretty general tutorial to suck people in, but the real value added might be in a specialized focus after the start
Build up to something useful and/or geeky cool
A unit on component integration (i.e. I can buy a Polar style heart rate receiver, and a MCU and a USB interface. How do I get them talking to each other so I can build an exercise data logger?)
What every you do, I'm looking forward to it (just learning embedded stuff in my spare time...).
There are the excellent tutorials at www.mikrocontroller.net, but they are in German.
If you could create something similar for an English speaking community, that would be great.
Yes! The more resources out there for helping with embedded software (microcontroller programming) the better.
It can be quite daunting to start with, especially if you've only written software for PCs or similar in the past. There are lot more constraints (e.g. on RAM and code space), and a whole load of things you need to know that don't apply to non-embedded software.
As others have mentioned here, there a number of websites that cover different aspects of this; some others are OnARM, for ARM processors, the related STM32 Circle, and Jack Ganssle's articles on his website and on Embedded.com.
Though embedded systems are an enormous market (just think how many such devices there are in your house, or in your car), my impression is that there is a lot less coverage of the subject on the web - and on Stack Overflow - than for non-embedded.
So, I look forward to seeing the fruits of your labour!
Something else that's worth to take into account when targeting beginners, is to directly provide pointers to useful resources, such as suitable simulators/emulators, or even addresses/webpages where you can easily order a starter kit or even free samples of some chips.
For example, most semiconductor manufacturers provide free samples of their products, e.g. see microchip.com or atmel.com.
Ideally, an introductory course would be based on working with such a hardware simulator or emulator in the beginning, so that the project and all relevant experience may directly map onto a real device once the beginner is interested in moving his work onto a real chip, providing pointers to freely available resources, or very affordable starter kits can be very useful.
This would ensure that beginners can get started as easily and cheaply as possible.
Maybe for the different ARM7 and CortexM3...?
Here everyone asumes there is a lot of information, but it is spread all over the net and without any red line what so ever...
But if you take AVR there is quite a lot of stuff over at http://www.avrfreaks.net, and I guess that PIC has quite a lot as well.
I have written many such examples myself but they are scattered and not organised and probably rarely read (one time the folks at avrfreaks borrowed something). StackOverflow might curb this but SO could in theory be used. Ask a question about boot code for an arm whatsit, then answer your own question with example code and text on how and why it works. The SO tags would be nice in that you could do a search on "boot" "arm" "embedded" and then one on "boot" "avr" "embedded", etc and get similar example programs for different platforms.
Personally I would go more in the direction of creating an example archive of complete programs for specific microcontroller versions (in typical uses), instead of making yet another "general" tutorial. E.g. one of microcontroller x/y that enables a serial port, one that configures a few digital outputs (setting TRIS and friends), how to set up common frequency/oscillator options etc.
When I started with PIC, (very short PIC16, then PIC18 then 24F and now dspic), one of the main problems is that all the examples are either only fragments or describing very general principles.
A tutorial is no good, if it takes more skills to get the examples actually working than the tutorial teaches.
I usually couldn't find one single complete program for exactly my controller, or even for the slightly wider group (that only vary in number of pins and memory/flash).
The initial program was always the problem, but sometimes later I had the same problem (initializing a certain peripheral) all over again (e.g. the encoder) It is specially frustrating if is the first run of a new micro controller line, and you might not be 100% sure of your hardware.
Unfortunately that takes some coordination, from a forum, an user group or so, since nobody has all devices, and all variants to wire them up (e.g. different oscillator options).

OOP Problems to use for Coding Tests during interviews

As a second interview I get people to sit down and write code...I try to make the problem really technology independent.
My programming problems that I have don't really exercise peoples OO abilities. I tend to try and keep the coding problem solvable within 2 hours ish. So, I've struggled to find a problem small enough and involved enough that it exposes peoples OO design skills.
Any suggestions?
This is a problem that I use with some trainings, looks simple but is tricky OOP-wise:
Create model classes that will properly represent the following constructs:
Define a Shape object, where the object is any two dimensional figure, and has the following characteristics: a name, a perimeter, and a surface area.
Define a Circle, retaining and accurately outputting the values of the aforementioned characteristics of a Shape.
Define a Triangle. This time, the name of the triangle should take into account if it is equilateral (all 3 sides are the same length), isoceles (only 2 sides are the same length), or scalene (no 2 sides are the same).
You can go on and on with quadrelaterals (which include squares, rectangles, rhombi, etc) and other polygons.
The way that they would solve the above problems would reveal the people who understand OOP apart from those who don't.
ideally, you want to present a problem that appears difficult, but has a simple, elegant, obvious solution if you think in OO terms
perhaps:
we need to control access to a customer web site
each customer may have one or more people to access the site
different people from different customers may be able to view different parts of the site
the same person may work for more than one customer
customers want to manage permissions based on the person, department, team, or project
design a solution for this using object-oriented techniques
one OO solution is to have a Person, a Customer, an Account, and AccountPermissions, where the Account specifies a Person and a Customer and an optional Parent Account. the use of a recursive Account object collapses the otherwise cumbersome person/team/department/project structure a direct ERD solution might yield
I have used the FizzBuzz Programming Test. And shockingly can corroborate the claims made by the article. As a second follow up I have asked candidates to compute the angle(s) between the hands on an analog clock. We set up a laptop with VS 2008 installed and the stub in place. all they have to do is fill in the implementation.
I am always stunned at how poorly candidates do on these two questions. I really am.
Designing Social Security Application is something which I ask a lot of people during interviews.
The nice thing about this is everyone is aware of how it works and what things to keep track of.
They also have to justify their design and this really helps me get inside their head :)
(As there is lots of flexibility here)
Kind regards,
Whether or not people do some coding in the interview, I make it a point to ask this:
Tell me about a problem you solved recently using object oriented programming. You'd be surprised how often people cannot answer that simple question. A lot of times I get a blank stare, or they say something like "what do you mean? I program in .NET, which is all object oriented."
These aren't specifically OO Questions, but check out the other questions tagged interview-questions
Edit: What about implementing some design patterns? I don't have the best knowledge in the area but it seems as if you would be getting two questions for the price of one. You can test for both OO and Design pattens in the one question.
How about some sort of simple GUI. It's got inheritance, overriding, possibly events. If you mean for them to actually implement as part of the test then you could hand them a blank windows-form with an OnPaint() and tell them to get to it.
You could do worse than ask them to design a MapReduce library with a single-process implementation. Will the interface still work for a distributed implementation? What's the exception-handling policy? Should there be special support for chaining MapReduce jobs in a pipeline? What's the interface to the inputs and outputs? How are inputs chunked up? Can different inputs in one job go to different mappers? What defaults are reasonable?
A good solution in Python takes about a page of code.
I've got a super simple set. The idea is mainly to use them to filter out people who really don't know their stuff rather than filtering in the rock stars.
These are all 5 minute white-board type questions, so they are really not that hard. But the act of writing up code, and talking through it reveals a lot about a candidate - and is brilliant for exposing those that can otherwise BS through the talk.
Write a method that takes a radius of a circle as an argument, and returns the area of the circle (You would be amazed how many people struggle on this one!)
Write a program that accepts a series of numbers as arguments from the command line. Add them up, and print the sum
Write a class that acts as a keyed counter (basically a map that keeps track of how many times each key is "counted")