Will a Machine Language Course Benefit My Computational Physics Emphasis?

Click For Summary

Discussion Overview

The discussion centers around the potential benefits of taking a machine language course for someone emphasizing computational physics. Participants explore whether the skills learned in such a course would be applicable or advantageous in the context of computational physics, considering both theoretical and practical aspects.

Discussion Character

  • Exploratory
  • Debate/contested
  • Technical explanation

Main Points Raised

  • One participant expresses interest in taking a machine language course but questions its relevance to computational physics.
  • Another participant suggests that while assembly/machine language may not be the most practical choice for computational tasks, it provides a deep understanding of how computers operate.
  • A different viewpoint emphasizes that knowledge of assembly language can enhance debugging skills and understanding of compiler behavior, which may be beneficial in certain computational fields.
  • Some participants argue that for specific areas in computational physics, such as quantum chromodynamics and astrophysics, a solid grasp of computer architecture and memory management is crucial to avoid inefficiencies in simulations.
  • One participant mentions that while the course may not be necessary, it could be worthwhile if the individual finds it interesting and can manage their other coursework.
  • Another participant points out that many of the concepts could potentially be learned independently, suggesting that formal education in this area may not be essential for everyone.

Areas of Agreement / Disagreement

Participants express a range of opinions on the usefulness of a machine language course for computational physics. There is no consensus on whether the course is essential, with some advocating for its benefits and others suggesting it may not be necessary.

Contextual Notes

Some limitations include the varying degrees of necessity for machine language knowledge depending on specific computational physics applications and the potential for self-directed learning of the material.

tmbrwlf730
Messages
41
Reaction score
0
I'm thinking of taking machine language over the summer because it seems interesting to me but I'm not sure if it'll be useful to my emphasis in computational physics. The objectives of the class are below, could anyone give me advice on whether it'll be helpful to me or not. Thank you.

A. Use flowcharts to describe program logic and use procedures when designing program structure
B. Discuss common applications of assembly language and what an assembler does
C. Perform binary arithmetic calculations with signed and unsigned binary integers
D. Explain basic boolean operations and recognize and convert boolean and hexadecimal integers
E. Describe how the operating system loads and executes programs
F. Represent integer constants, expressions, real number constants, character constants, and string
constants in assembly language
G. Formulate assembly language instructions using valid syntax
H. Use the OFFSET, ALIGH, PTR, TYPE, LENGTHOF, and SIZEOF operators PUSH and POP
I. Link programs to an external code library
J. Create conditional and looping structures using assembly language
K. Use the high-level MASM decision and looping directives such as .IF, .ELSE, .REPEAT, and WHILE
L. Explain and use the MUL, IMUL, DIV, and IDIV instructions
M. Discuss how stack frames are used by high-level languages
N. Write recursive functions in assembly language
O. Use the advanced forms of the INVOKE, ADDR, PROC, and PROTO directives
P. Traverse a two-dimensional array using advanced indexed addressing modes
Q. Create nested macros and macros with multiple parameters
R. Use heap allocation functions to create dynamic data structures
 
Physics news on Phys.org
I cannot imagine why any sane person would choose assembly/machine language for computational anything. Pretty much any other language you can think of (C, C++, VB.NET, FORTRAN, JAVA, etc) would be better.

On the other hand, assembly/machine language will teach you how computers work in a way that none of the others can even approach.
 
phinds said:
On the other hand, assembly/machine language will teach you how computers work in a way that none of the others can even approach.

This is the main point: teaching how computers really work.

You have a lot of interesting things that need to be paid attention to especially if you are writing OS code components, device drivers, and even some optimized code using a particular mechanism like the floating point calculator or some kind of vector processing component like the SIMD SSE, SSE2.

What it forces the programmer to do is understand what everything in memory really represents and how flow actually works on a computer.

A lot of people don't realize the complications in doing simple things like allocating memory in an environment that separates the kernel from the application space and even amongst processes or things like device drivers where you need a tonne of assembly language to not only do simple things like print a character or set the screen mode, but also to co-ordinate everything in an optimal and fault free way. This is not as easy and many people think.

The thing is that if you have done a bit of assembly, you'll have a really good idea of what your compiler does to generate data structures (even in C++) as well as how functions and addresses are computed and also what is going on 'in-between process cycles' with all of the other stuff that the OS has to take care of. It also can help you become a better debugger as well.

Most people won't use it for most of their software development, but it is far from useless.
 
Joel Spolsky, founder of Stack-Exchange and Fog Creek (a very Google-like startup), has some really good things to say on why someone working in software should have some understanding of every level of development:

http://www.joelonsoftware.com/articles/LeakyAbstractions.html

There are certain fields of computational physics, like doing quantum chromodynamic calculations, astrophysics/hydrodynamics, electromagnetics, etc. that will require some very in-depth knowledge of how computers work. The reason for this is because QCD simulations can sometimes take months (someone mentioned a year-- A YEAR!), or astrophysics simulations can take a month on hundreds or thousands of nodes on a supercomputer. When you're dealing with this kind of scale, it's important to make sure that you're not wasting any time because you're implementing stupid/inferior algorithms, creating a bottle-neck because of some basic hardware architecture that you were unaware of, ignorant of how memory management works, etc. Anything could throw days, or even weeks, into your total run time. Also knowing how the computer handles and represents data is kind of crucial if you're coming up with garbage values or you need some extreme precision.

Still, these are things you could learn on your own. I wouldn't take a class on it... but that's just me. Most people can't learn those kinds of things by themselves, but physics PhDs (assuming you want to go to graduate school) are a special kind and should be able to do that sort of thing. Also, you may not be very motivated to learn it too.. but anyway, point is that you ought to be able to learn it independently.
 
tmbrwlf730 said:
I'm thinking of taking machine language over the summer because it seems interesting to me but I'm not sure if it'll be useful to my emphasis in computational physics.

Why does it have to be? If you can take the course without failing or leaving out a more important one, just do it if it seems interesting! :smile:
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 13 ·
Replies
13
Views
4K
Replies
10
Views
5K
  • · Replies 40 ·
2
Replies
40
Views
9K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
6
Views
3K
Replies
60
Views
18K
  • Sticky
  • · Replies 13 ·
Replies
13
Views
8K