Question
You need a UNIX or Linux account. and access to the command line Free ones are available from Google, Amazon, Microsoft and possibly other places.
You need a UNIX or Linux account. and access to the command line Free ones are available from Google, Amazon, Microsoft and possibly other places. Those with access to a Mac can go to /Applications/Terminal, and will have a command line. There are two Macs in the lab.
- Read about the bash shell available with Unix/Linux, and find out how to set environment variables. - Read up on and be prepared to use such unix commands as cat, man, grep, |, ls, and cd
- Read up on and be prepared to use one or both of the editors vim or nano or a similar editor.
- Prepare a "hello-world" type of program in C++
Overview
Use Linux commands to navigate the system and determine what files are stored where. Compile and run a small C++ program in Linux.
Learn how to use Logicism.
1. use cd / to change directories to the top of the directory hierarchy and from there use ls to list the contents Try using ls -a (hand in) What is the difference?
2. (hand in) What kind of files are stored in each of bin, home, lib, var, misc, sys, and usr?
3. (hand in) Having answered this, find your own directory and say what the path to it is.
4. examine your account startup file (.bash_profile or .profile or any other .profile files you see), say using
cat to put the info on the screen. (hand in) What PATH includes are present? Try using set | grep PATH (hand in) What's the difference? Now look up and explain the parts of this last command. The command “man set” might help.
5. Use a text editor such as vim (may not be installed) or nano (should be installed) to type your C++ program into a text file, then use the g++ program to compile it. Run it. Tell me this is complete.
Here is a very simple one, but you will have to experiment and elaborate somewhat, say to at least a dozen lines and a few more commands.
#include using std::cout; using std::endl;
int main() {
cout <<"Hello World"<return 0; }
To compile the above file, save it as hello.c and compile with: g++ hello.c –o hello
That compiles and outputs to an executable called hello. Without the “-o hello” the standard a.out file is created.
To test the compiled hello program type: ./hello
Or ./a.out if you didn’t specify the object file to create.
NOTE: You must hand in your actual code and a copy of the output it produces.
6. Select a component kit box, dust it off, record its number, and remove any paper, dismantle any circuits except the power jumpers (see #8). Write down the box number you selected here: Your box #: _____
7. Put a piece of paper with you and your partner’s names inside.
8. On your breadboard, connect the red power supply to Va and the black to ground. (usually green) Jumper
red to the + on the strip below, and black to the - on the strip below, then for each section of the breadboard you use, jumper that strip to the corresponding power strips for that section. (This may have been done already)
9. Download, install and run the program Logisim (free on Windows. Mac version may not work with the latest MacOS) on your own computer. Using this program, find out how to build a circuit for a 4-input AND gate from a minimal number of two-input AND gates.
10. Check your kit and make a list of what is missing. Put any surplus copies of chips into one of the plastic bins in the section labelled "supplies". More supplies will be ordered if needed.
Possible Resources:
Digitsim:
• https://sourceforge.net/projects/circuit/
• http://logisim.software.informer.com/download/
Linux console:
• Google Cloud Shell (this part is free)
• The Amazon Web Services (AWS) Free Tier
Supplies: Your kit should initially contain:
1. 5V Power supply
2. breadboard (3 sections of the one like in the text)
3. digital probe
4. 4MHz CR64 Crystek clock
5. 8 bit digital clock display
6. 6+ LEDs
7. 8 position dip switch
8. wire
9. resistors, small capacitor
Chips (The numbers are engraved or painted on the top): 2 each of:
1. 74AC00 quad 2-input NAND gate
1 each of
2. 74AC02 quad 2-input NOR gate or 74AC32 quad 2-Input OR Gate
3. 74AC04 hex inverters
4. 74AC08 quad 2-input AND gate
5. MM74HC175N Quad D FlipFlop same as 74AC175 - Quad D FlipFlop
6. 74AC138 - 1-of-8 decoder/demultiplexer.
7. 555 Timer
8. 7493 Counter
Step by Step Solution
3.46 Rating (149 Votes )
There are 3 Steps involved in it
Step: 1
include int main stdcout Hello world stdendl return 0 1 The command cd changes the directory to the ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started