Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: utilizing the ALU  (Read 4749 times)

0 Members and 1 Guest are viewing this topic.

EEVIAC

  • Guest
utilizing the ALU
« on: December 14, 2009, 10:55:29 PM »
Once I eMailed a college instructor.  I was just inquiring about a programming class that was offered at the time.  He mentioned that if I want to learn programming, I should learn trigonometry.  Of course I didn't understand what the heck that meant.  But later I read in Upgrading and Repairing PCs that if you want to take advantage of the Arithmatic Logic Unit in any cpu, code has to be specifically written for it.  Since the ALU deals with "more complex" math operations, I could only conclude that this is what the instructor was talking about..    Is this accurate? 

geek hoodlum



    Apprentice
  • Thanked: 25
    • Yes
  • Experience: Familiar
  • OS: Windows 7
Re: utilizing the ALU
« Reply #1 on: December 14, 2009, 11:08:24 PM »
What is the relationship between mathematics and the field of computer science?
Quote
Computer science is broadly concerned with the application of both mathematics and logic to the task of designing and controlling computers. Certain branches of mathematics are of special value in computer science such as boolean algebra and discrete mathematics. One place where math is applied is in the microprocessor unit of a computer which executes a stream of simple operations including arithmetic operations.

Based on the answers I found from WikiAnswers I believe the college instructor is accurate.

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: utilizing the ALU
« Reply #2 on: December 14, 2009, 11:09:08 PM »
Not really. the ALU is part of the actual CPU itself- you must mean the FPU, for floating point, which used to be a separate add-on on before the 486DX (so we had the 287 co-processor, 386 coprocessor, etc.

And really, I don't see why you'd need much of a background in trigonometry; certainly high-school trig has been enough for me so far, and I've had a few pretty trig-intensive projects. (my geometry/drawing library, for example).
I was trying to dereference Null Pointers before it was cool.

Salmon Trout

  • Guest
Re: utilizing the ALU
« Reply #3 on: December 15, 2009, 12:34:31 AM »
I can see where the instructor was coming from. It's not so much trig per se, more the mindset it encourages and nurtures in an apt pupil, to do with thinking logically about problem solving and developing formal proofs that I reckon the teacher was thinking about. Algebra would come in handy too. I know these are dull unfashionable subjects these days.


EEVIAC

  • Guest
Re: utilizing the ALU
« Reply #4 on: December 15, 2009, 01:21:01 AM »
Well I know Algebra...  :)  I've past the prerequisite for taking Trig. at a community college, so I've got basic logical thinking down.  I've taken some digital classes also where boolean algebra, binary, hex, and other number systems were emphasized.

thx all

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: utilizing the ALU
« Reply #5 on: December 17, 2009, 01:57:49 PM »
Quote
And really, I don't see why you'd need much of a background in trigonometry;
What is that supposed to mean?
Real Life engineering problems are solved using some branch of trigonometry.

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: utilizing the ALU
« Reply #6 on: December 17, 2009, 02:47:16 PM »
What is that supposed to mean?
Real Life engineering problems are solved using some branch of trigonometry.

engineering and programming are different things. a strong background is far from required; I have only gone through high-school and I've used a lot of trig in many of my programs (actually, I only wrote the code once, and reused it thereafter.).

"Real-life engineering" and "programming" aren't synonymous. One is engineering. One is programming. They certainly have an overlap, but the point is, you don't need to be an engineer to program any more then you need to be a programmer to... um.... engineer. (And don't get me started on that whole invented vocation of "Software engineer" it sounds almost like some sort of cover, like "Sanitation Engineer".

Additionally, having a strong grasp of trig- or math, even- is really quite useless when you design a UI. I mean, the users only want it to be easy to use- they don't give a *censored* if the number of pixels between adjoining buttons is a prime number or any of that.

Engineering programmers solve engineering problems. for engineers. Therefore they can expose their users (engineers) to such arcane things as using j for complex numbers or engineering formulae. A Program to simulate the pressure and flow of liquid through a pipe given the pipes diameter, the material of which it is constructed, and the viscosity of the liquid flowing through it may be useful to engineers designing pipes, but is completely useless to the average person (unless they really really really like Mario and wish to examine how quickly he moves through pipes, or something).


Also, I might add that while such programming jobs are extremely invaluable- you don't hear about them. Really, when somebody invents, say, a new pipe system, or a new material, or a new type of plastic, do they ever say, "And these are the programmers that wrote the program that helped me synthesize this plastic" or anything? No. They get their god *censored* nobel prize and the people responsible for the software that made it possible are discarded like a used diaper. The programmers who get recognition are the ones who deal with ordinary users- and while occasionally this may require some trigonometry; the very mindset of a good programmer makes it easy to absorb this information; and, really, any sort of mathematic study, when the situation requires. which may be the point- the fact is, you don't need a strong background in trigonometry, because the very essence of a programmer means that, where trig is required- they will learn it. It's one thing to learn about trigonometry in a classroom setting, it's quite another to use it and "re-learn" it in a setting were the output isn't simply numbers on an answer sheet but real world results in a program- where errors can be seen nearly instantaneously.

To illustrate my point; again- I only have "officially" a high-school education in... well, formally, anything, I suppose. I would be in a far less intelligent boat if I had never found programming, since it essentially made me revisit the old subjects (well, except english, I suppose, but I've always been pretty good with language), and they gave them a new "face" so to speak, and made them interesting. While Complex numbers were only mentioned in passing in school, I had a firm understanding of them quickly. Why? I wrote a class that performed Complex arithmetic. the Benefit? Now my evaluator supports complex numbers. I was in fact even considering adding HyperComplex and Quaternions, but, I figured that was a bit overboard.

Reiterating once again- it is not WHAT you know that determines wether you'll make a good programmer, but really, it's a matter of how your mind absorbs information; some people's minds don't work in a way that lends itself to formulating instructions for a computer. Which actually works great because their interests usually lie elsewhere.

I was trying to dereference Null Pointers before it was cool.

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: utilizing the ALU
« Reply #7 on: December 17, 2009, 03:34:31 PM »
B, you are arguing about a strong background in trigonometry. What I meant was you need to have a basic understanding of trigonometry and related ideas in order to deal with things in real life. In the real world people have to manage, maintain, modify, re-build and re-create many things about them. They have to have some concept of special reasoning. They have to be able to see things in a three-dimensional world and be able to understand the relationship between mass and size area and volume and so on. Even if a person does not have a formal understanding of these things, he still has to have the concept. A common problem many people have is not understanding the idea of geometric expansion. This is a real world problem. People think that if they know how to build a one-story house, they'll be no problem in building a two-story house, or even a three-story house. Individual has to have some fundamental concept of how things get larger and how their characteristics change in the real world. Oftentimes we use models to explain things or illustrates the ideas. We have to understand the relationships between a model and the full size article. Even if you're not into any kind of building work, let's say you're even just working in on a farm. Even then you have to understand basic concepts of how a calf is going to require more and more food as it gets bigger and bigger. And this requires some basic understanding of math. And if you going to buy more cows and you're going to buy more land, eventually you'll come into a problem that could be easily solved by a basic knowledge of trigonometry. No, I did not mean to say that a person has to have a deep knowledge of these kind of concepts. I meant to say you have to understand the basic idea. And yes, this is also related to algebra.
Not that I'm in favor of drowning students in algebra. It should be made easy to understand and they should understand the concepts. Being able to figure out trick problems is not the goal. Use of mathematical methods is one way to solve problems where we have some known things and some things are not unknown and we try to make an estimate of what the outcome will be.
Programmers make serious errors when trying to estimate the amount of man hours that it will take to complete a project. Hotshot programmers almost always fail to estimate the amount of time it will take to get the program completely debugged, documented and delivered to the user. This has nothing to do with understanding how to make a programmer friendly to the user. The idea here is to not just create a nice graphical user interface, but to be able to debug, refine, verify and catalog it. Some junior programmers have no idea that if they use certain types of functions in their program they're going to eat up all the disk space available. They don't understand the math involved. There's a big difference between a recursive program that makes 32 iterations and a recursive program that makes 48 iterations.
Oh my, this is getting to be a rant.   (|

geek hoodlum



    Apprentice
  • Thanked: 25
    • Yes
  • Experience: Familiar
  • OS: Windows 7
Re: utilizing the ALU
« Reply #8 on: December 17, 2009, 06:22:18 PM »
A formal degree in CS or IT requires Mathematics. Higher or basic mathematics train you to think logically in developing programs. It's up to you if you don't want Trigonometry, but in formal education, indeed you need mathematics.

If you're not satisfied enough, try to consult a PhD. or DSc. in Computing/CS.

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: utilizing the ALU
« Reply #9 on: December 17, 2009, 06:44:45 PM »
Formally, yes. you will need something like that as a prerequisite. And really- it can only help. but the way it was phrased, it appears that this was an "informal" recommendation:

Quote
He mentioned that if I want to learn programming, I should learn trigonometry.

in my mind, I see a conversation like this:

"hey, I want to learn programming."

"oh really? Well, I think, you should learn trigonometry first."

which is completely baseless; there is no statement of pre-requisites, which their certainly will be- it was basically saying, "well, you need to know trig before you can take programming! Everybody knows you can't parse a string without knowing the Sine Laws!".

Also, completely OT but I personally find formal degrees meaningless. I've met people that supposedly have CS degrees who are about as intelligent as a cantaloupe, and would certainly find competition from one. Now, this obviously is not the case for everybody who goes through it, but it's pretty redundant- the way software is written in academia is a lot different from the way it really is.

Quote
Higher or basic mathematics train you to think logically in developing programs.

I see what you mean here... but that isn't really strictly true; the mindset of a mathematician does not necessarily mean they would be a good programmer, for example.

What's important is analytical thinking and, basically, using a set of tools (functions, statements, control structures) to perform a specific task. This is the easy part. What's important then is finding ways to make it go faster.

A example might be sorting; almost any person who took even the most basic programming course can probably write a bubble sort function in some language; it's really quite basic, and the code flow is easy to follow.

But even programmers in the industry have trouble writing a quick-sort, ot shell-sort function. why? well, for many languages, such as python, sorting has become an atomic action. Sure, understanding the concepts behind it is important, but for most cases, it's enough to know that it sorts. It's not important How it sorts.

Academia finds all sorts of esoteric methods of sorting- this is how the quicksort (or my favourite, the shell sort) came about- through intense study of the problem. However, it's important to realize that the same skills do not necessarily translate to financially sustainable programming in all scenarios.

Basically- I feel that programming is not something that everybody can learn, regardless of the courses taken. Certainly anybody can take a programming course; but that doesn't make anybody a good (or even a mediocre) programmer any more then, say, a course in psychology can make a person a good psychologist. There are a number of different personality traits and aptitudes that are important in becoming a programmer, just as there are a number of important personality traits and aptitudes to becoming a psychologist.

What ends up happening is that the wrong people might want to work in the industry, and they can, but they will have larger barriers to overcome them people who "have the knack" for it.

What does this have to do with the topic? Well, actually, I forgot. Oh well.

I was trying to dereference Null Pointers before it was cool.

geek hoodlum



    Apprentice
  • Thanked: 25
    • Yes
  • Experience: Familiar
  • OS: Windows 7
Re: utilizing the ALU
« Reply #10 on: December 18, 2009, 01:43:59 AM »
Keep going guys. I like this thread.

Quote
"hey, I want to learn programming."
"oh really? Well, I think, you should learn trigonometry first."
which is completely baseless; there is no statement of pre-requisites

But in formal education, this is a prerequisite right?

Maybe it's up to the person if he/she really want to be a programmer regardless of education. He/She can be what he want! :-)

In my opinion, a programmer for me is a gifted person. Hehe. Lots of peeps out there dream to become one but not all are successful.

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: utilizing the ALU
« Reply #11 on: December 18, 2009, 08:51:16 AM »
But in formal education, this is a prerequisite right?

True, I suppose really I'm splitting hairs. What I mean is, it sounds more like a comment that was made colloqiually- a recommendation. Now that I think of it over again, it certainly cannot hurt to take those courses. Heck I wish trig stuff had been fresh in my mind when I was working on my basemetry library. All I could remember was SOHCAHTOA... forget the Sine laws or any of that, heh.

In fact things went reverse for me, oddly. I was able to use my programming abilities to help me in math- since we were supposed to have a graphing calculator (In fact, TBH the whole class seemed like a tutorial on the freaking thing sometimes... "this is how you do standard deviation..." And- they don't even tell you the freakin formula until half-way through that section, and even then it's merely regarded as a "trivial detail". Ridiculous.


Not to say I did badly in the course without my programming- I went through the first 3/4 of the course with just a scientific calculator... I had to look up half the bloody formulae for the course, since, as I just mentioned, it was basically a bunch of lessons on what buttons to push.

Anyway- as I was saying- I made the whole thing a LOT easier then it even was once I had the TI-83, since I wrote a good number of programs that pretty much made the final exam a bunch of mindless button pushing.

I didn't get 100% because I had to skip a few synthetic division questions. strangely I remember WHY I didn't, and never have, had any really grasp of synthetic division- it was because I was writing design specs for programs in grade 10 instead of paying attention :P.

I've never really considered myself that good with math, but now that I think about it, I might be wrong. I mean I WAS the only one in the course who calculated through the quadratic formula more then once. (thereafter, people all used a graphing calculator program that was provided... I of course wrote my own instead, and a good number of utilities, too.
I was trying to dereference Null Pointers before it was cool.

macdad-



    Expert

    Thanked: 40
    Re: utilizing the ALU
    « Reply #12 on: December 19, 2009, 07:25:50 AM »
    BC is right even if you did Assembly programming for a specific proccessor you wouldn't need any prior knowledge(not including the actual commands and flags of course  ;)) but you would still need some basic knowledge on how it'll actually run from the command structure and sequence, not to mention that ASM is just broken into different bytes, these bytes neccessary to know how they interface with the different parts of the system are basically read by a memory access circuit that 'directs' the bytes to the different sections(ALU, outputs, inputs, etc.)

    If you were to access the ALU it would be kinda pointless to do so since its already built-in. You would have to learn Binary Logic/Mathematics since thats basically how the Memory, ALU, and other parts work. They use electrical gates that give a output according to the input(Like a proccessor) but they have specific wiring that makes them only output when certain conditions are true.

    For example an AND gate takes two(or more) inputs and if all the inputs are true(when a 1 is applied) then the output becomes 1.
    The outcomes of the gates is shown on something called a Truth Table:


    This is all shown in Binary Math/Logics.
    If you dont know DOS, you dont know Windows...

    Thats why Bill Gates created the Windows NT Family.