HP Forums

Full Version: CARDIAC: CARDboard Illustrative Aid to Computation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Has anybody learned programming with the CARDIAC?
How hard was that? Or was it fun?

Cheers
Thomas

PS: There's a simulator for the HP-42S if you want to play around with it.
I got one of those from Bell Labs in the 1970's. I already knew programming (FORTRAN) at the time. I played with it for awhile, but it really didn't teach me anything important that I didn't already know from programming school (including IBM assembly). I think it is designed for those who don't know anything about programming but want to learn a bit.

I've still got it, by the way.
This is very similar to the "little man computer" which is also an educational set and is more capable.

LMC, like CARDIAC is decimal based and very easy to explain and learn.

http://en.wikipedia.org/wiki/Little_man_computer

I actually developed a single-board computer two years ago that executes LMC instructions.

http://youtu.be/HNK9imVcz_E
(10-11-2014 10:16 PM)Don Shepherd Wrote: [ -> ]I got one of those from Bell Labs in the 1970's. I already knew programming (FORTRAN) at the time. I played with it for awhile, but it really didn't teach me anything important that I didn't already know from programming school (including IBM assembly).

I like how simple it is. The boot-loader program is just two instructions:

002 INP 02
800 JMP 00

And still it's powerful enough to provide:
  • Indirect Loads
  • Indirect Stores
  • Array Indexing
  • Stacks
  • Subroutines
  • Recursion

Who would think, that you can run "Towers of Hanoi" on it? But I admit it's more like a punishment if you ask someone to run it for 5 disks on the real hardware. However it's fun to watch it running in the simulator in slow motion.

It was new to me how subroutines are provided:
Quote:In the CARDIAC, the JMP instruction is effectively a jump-to-subroutine instruction, storing the return address in location 99. Because the address stored in location 99 is prefixed by the opcode 8, the instruction in that location becomes a return-from-subroutine instruction. Thus any segment of code whose last instruction is at location 99 can be called as a subroutine, simply by jumping to its first instruction. For example, a simple routine to double the value of the accumulator could be coded as:
Code:
97      696     double  STO     96
98      296             ADD     96
99      800             JMP     00
and the subroutine can be called with a jump to double:
Code:
        897             JMP        double

Thus I definitely learned something.

(10-11-2014 10:16 PM)Don Shepherd Wrote: [ -> ]I think it is designed for those who don't know anything about programming but want to learn a bit.

As far as I know it's from a time where access to a computer was difficult.

(10-11-2014 10:16 PM)Don Shepherd Wrote: [ -> ]I've still got it, by the way.

In the manual a program to play "Single-Pile Nim" is developed. A slightly different rule is used as you may not remove the same amount of pebbles as your opponent during his turn. In other words, if your opponent has just taken two pebbles, you may take one or three, but not two.

You could take it to school and let the your pupils play. There's also a kit they could assemble themselves.

Cheers
Thomas
(10-12-2014 05:47 PM)Thomas Klemm Wrote: [ -> ]You could take it to school and let the your pupils play.

Thanks Thomas. We tried teaching BASIC to our students a few years ago, and it was not a success for the most part. Some of them understood the general concepts, but their brains have not developed to the point where they can do programming beyond the "Hello World" level. It was a frustrating experience for them and the teachers (George and I, both retired programmers).

Our students are 11-14 years old. It is a daily struggle to teach them anything more than just the basic 4 math operations.
Though I don't have the experience to teach this specific age range there might be more suitable languages to start with:
It's probably easier to to get them engaged with sound, games or graphics than by calculating the greatest common divisor of two numbers.

Cheers
Thomas
(10-13-2014 04:10 PM)Thomas Klemm Wrote: [ -> ]Though I don't have the experience to teach this specific age range there might be more suitable languages to start with:
It's probably easier to to get them engaged with sound, games or graphics than by calculating the greatest common divisor of two numbers.

Cheers
Thomas
Yeah, I did buy a book on Scratch about a year ago and played with it for awhile. Constructing your program with pre-defined "blocks" avoids the syntax errors that always accompany most programming languages.

I also bought a programmable robot a few years ago, and its language is a lot like Scratch, and you can do some clever things with it, like program it to follow a line that you layout on the floor. Someday we might turn that into a course, who knows. But for now we concentrate on the basics of math.

Don
(10-12-2014 05:47 PM)Thomas Klemm Wrote: [ -> ]In the manual a program to play "Single-Pile Nim" is developed. A slightly different rule is used as you may not remove the same amount of pebbles as your opponent during his turn. In other words, if your opponent has just taken two pebbles, you may take one or three, but not two.

I had one of those as a kid and I was amazed how it could do something intelligent while I was just executing simple instructions. A perfect Chinese Room experiment.

Peter
Reference URL's