Altera Code Samples

For my Digital Fundamentals course, we use an Altera FPGA with a Cyclone II chip on it. My final project is to build a timer, which I want to set with 4-bit binary input from switches; the decrementing seconds should got to 7-segment LEDs. I've been searching about and found that Altera provides plenty of source VHDL code to start with.

Thank, Altera!

A Quirk When Writing C in BootCamp

I currently do most of my Windows work in a BootCamp partition on my Mac. This evening, while writing C code in Microsoft Visual C++ 2010 Express, I ran a program that reads the contents of a text file and displays them in console backwards, from EOF to start. The curious thing was each character was doubled. Why was this?

So I disabled the following code: Aha!

//for Mac
if (ch == '\r') {
putchar('\n');
}
else {
putchar(ch);
}

So the something is apparently still being recognized as Macintosh, even though I'm booted in Windows 7. Interesting.

Fall Break

The end of my mechanics LAN marked the start of the week-long fall break at Ivy Tech. A number of things have piled up, notably final projects for two classes: C and digital circuits. This break will be quite busy.

Fall Break

The end of my mechanics LAN marked the start of the week-long fall break at Ivy Tech. A number of things have piled up, notably final projects for two classes: C and digital circuits. This break will be quite busy.

C/C++ Compiler for iOS

While reading through my C textbook, C Primer Plus, I decided to search the iTunes Store for a C compiler; I was quite surprised to find one called C/C++ Compiler for $1.99. I bought it and promptly typed in two examples from my textbook. One crashed the compiler; the other identified an error (I forgot to return a value) and ran just fine.

Using the keyboard for input, such as entering your age to capture with scanf(), seems to cause runtime crashes. Yes, I have not read the documentation or support forums: I've had the program only a short time.

I don't envision doing much programming on my iPod, but it's neat to be able to do so for such a low price. Having a folding Bluetooth keyboard helps greatly.

National Division through Self-Selection

This morning I came across an interesting article about the increasing physical political polarization in the US. This is a bad thing, as it fosters distrust, division, and stereotyping. The cultural schism has been clear for quite some time; however, that seems to be playing out as a hardening of groupthink and identity politics. It seems people increasingly choose, when possible, to move and live among their ideological brethren. One example is Obama winning the recent election in 8 of the 10 wealthiest counties in the country; "the rich" mainly supported him from their enclaves. From my acquaintances, I've heard strong avowals never to live in Texas in order not be among their kind.

After years in Japan, I am not too particular about where and among whom I live, although I would like to live along the Ohio River: I love the topography. However, I certainly do not want to live in Oakland, California, where a camera crew doing a live broadcast at a school get robbed by guys driving a Mercedes-Benz.

Kittikun.jp

Occasionally I search for new internet radio channels in iTunes, often seeking electronica that is repetitive but not distracting. Chilluminati is usually not bad, but it seems their streams drop with increasing frequency and some of their mixes seem designed solely to grate.

The other night I found Kittikun.jp, which bills itself as "Deep House, Tech House, Minimal, Techno." So far, that has worked for me. I rarely need to change the channel or volume. It is, as some say, a good deal.

Projects & Tests

Friday concluded the midterm tests. I got As on both the exam and lab test for Digital Fundamentals; for the C test Friday, an A is highly probable.

Both courses have final projects. The C course's project will be to read a graphic file and offer operations like making a (photographic) negative, adjusting saturation, tweaking the individual RGB values, and encoding. I've not processed images before, so it should be quite interesting.

The other course's project is to make a timer with logic gates and display the 4-bit value countdown in a 7-segment LED.

These will be difficult projects, but they should teach me much and be enjoyable. I look forward to completing them.