Computer Science 250 Lab 1

Since we haven't had a lot of class yet, this lab is a collection of questions, plus requires you to make an account on isoptera. Make a lab report with the answers.
  1. Convert 100 (decimal) to binary and hexdecimal with no computer assistance. Put the answers in your lab report, and turn in a short report with the answers to each question in this lab at the end..
  2. Ask for an account on isoptera, if you don't already have one. Once you have an account, you can log in using PuTTY, available at http://www.chiark.greenend.org.uk/~sgtatham/putty/. After logging in, you will be presented with a command prompt. Enter the following and press enter: text2binary convert this text.
  3. Now that you know how to use text2binary, use it to answer the following questions (put these in your lab report):
    1. Do uppercase or lowercase letters have larger ASCII values?
    2. Do digits (numbers) have their own ASCII values? (i.e. does the digit 8 have the ASCII value 8?)
    3. What is the ASCII value of a space? Use quotation marks to enter the space into text2binary.
    4. What does your name look like in binary?
    5. What is the highest character value you can find? Some characters have special meanings on the command line, and may require quotation marks to enter. If you want to enter a quotation mark itself, use \"
  4. Write a short C or C++ program, build it with gcc or g++, and open up the binary with the debugger (gdb). Once it's open, run "disas main" to disassemble your main function into assembly. Memory addresses will be listed to the left of the assembly instructions. How many bytes of space does the code for your main function take up? If you haven't built a program using gcc or g++ before, take a look at video 2 from last semester's CS211 website
  5. Suppose a friend sends you a 1,500 watt space heater from Germany, where the usual voltage delivered to outlets is between 220 and 240 volts. With a bit of creativity and a hammer, you manage to plug it in to a standard US outlet, delievering between 110 and 120 volts. How many watts of heat should you expect it to produce?
Upload your lab report to the course uploads area