MIME 4450 Lec 3 9 8 26
Watch on YouTube →
Overview
The lecture connects digital logic and binary representation to practical control tasks, showing how 32-bit words can encode valve states and Rubik’s Cube moves for programmable logic controllers. It then reviews binary counting, integer and floating-point tradeoffs, base conversion, two’s-complement arithmetic, hexadecimal, BCD, Gray code, and the robot kinematic singularity that can interrupt motion.
Key takeaways
- A 32-bit PLC word can carry a compact control instruction: allocate bit fields to colors, tile indices, move directions, and status flags, then decode the fields when executing the move.
- In a valve nest, mask out don’t-care conditions and XOR the relevant present and target states; a nonzero mismatch indicates that the liquid transfer should be blocked.
- Integers are reliable for counts and packed bit patterns, while floating-point calculations can leave tiny residuals; compare real values to a tolerance such as 0.00001 rather than exact zero.
- Two’s-complement subtraction works by inverting the subtrahend’s bits, adding one, and adding the result to the first operand; the carry beyond a fixed-width word is discarded.
- Hexadecimal maps one digit to four binary bits, while Gray code changes only one bit between adjacent values, reducing position ambiguity at encoder transitions.
- Robot kinematic singularities can prevent a controller from calculating a valid next movement, so robot paths must account for and avoid or pass through singular configurations deliberately.
Chapters
- MIME 4450 assignments and project materials are posted through the hybrid PLC course site; the week-three assignment is still forthcoming.
- The instructor plans to return graded work around Thursday and keep scoring consistent across the 14 assignments.
- Digital logic is introduced as Boolean operations such as AND, OR, and XOR, because PLCs pass packed values that later must be decoded.
- Chapter 13 treats matrices and arrays as structures for organizing and transferring application data.
- A Rubik’s Cube project prompted use of matrices to compact move information for a PLC, although later examples showed that PLC-based solutions were possible.
- The key controls-engineering cycle is iterative: test a move, observe the result, revise the program, and repeat.
- A valve nest routes liquids among storage tanks and truck connections, so bit patterns represent valve positions and permitted transfers.
- The example uses 32-bit words for required-on states, required-off states, and don’t-care bits, with masks removing irrelevant conditions.
- An XOR comparison between the masked target state and present valve state identifies mismatches; a nonzero mismatch prevents the transfer.
- The proposed solver treats each array entry as one move, with each move encoded in a 32-bit word.
- A sequence can build a stage such as the white cross, but the program must account for each piece’s possible starting positions.
- Excel can help generate and inspect move tables before their values are copied into a PLC program.
- The illustrative word allocates three bits each to two color fields, six bits to each tile index, and individual bits to move direction and status.
- Three bits represent values 0 through 7; six bits represent 0 through 63, enough to index the cube’s 48 movable tiles.
- The example assigns separate flags to clockwise 90-degree, clockwise 180-degree, and counterclockwise 90-degree turns.
- Weighted powers of two combine the fields into one integer; a PLC can later unpack that integer to recover the move instructions.
- A bit is a single 0 or 1; four binary bits represent values from 0 through 15, while six bits represent 0 through 63.
- Integers suit counts and packed Boolean information because they avoid floating-point rounding error.
- Floating-point values provide decimal precision, but repeated calculations can leave tiny residuals, so comparing a real value directly to zero can fail.
- For real-number tests, compare against a small tolerance such as 0.00001 instead of requiring exact equality with zero.
- The sum-of-weights method converts binary to decimal by adding the powers of two corresponding to set bits.
- To convert a decimal integer to another base, repeatedly divide by the target base, record each remainder, and read the remainders from bottom to top.
- The repeated-division method generalizes to bases such as 2, 8, 16, or 23.
- Hexadecimal became a practical working notation for the instructor during assembler programming, illustrating how familiarity with a base can become habitual.
- Binary addition follows the same carry principle as decimal addition, with carries moving into the next bit position.
- Rather than manually subtracting binary values, flip every bit of the subtrahend and add one to form its two’s complement.
- Adding that two’s-complement value to the first number performs subtraction; any carry beyond the fixed word width is discarded.
- The lecture demonstrates the method with 8-bit examples and notes that binary multiplication and division are generally not worth hand-calculating for this course.
- The worked example verifies that adding a positive 53 to its 8-bit two’s-complement negative produces eight zero bits after the overflow carry is dropped.
- In signed representation, the leftmost bit is the sign bit: 0 indicates a nonnegative value and 1 indicates a negative value.
- A programmer must decide whether an integer variable is signed or unsigned, since the same bit pattern can be interpreted differently.
- PLC data transfer commonly uses 16- or 32-bit integers, or floating-point values, depending on whether the data represents counts, packed flags, or measured quantities.
- Floating-point values encode a mantissa and exponent; the lecture contrasts their precision with integers’ exact representation of whole-number counts.
- An arithmetic operation can set an overflow flag when its result exceeds the available word range, and the program must decide whether that condition matters.
- Hexadecimal uses 16 symbols, 0 through 9 and A through F, and each hexadecimal digit corresponds directly to four binary bits.
- Octal groups binary data in sets of three bits and is now uncommon in industrial control.
- The PDP-8 is cited as a historical octal-based computer; later systems such as the PDP-11 helped shift practice toward hexadecimal and 16-bit data.
- Binary-coded decimal assigns a four-bit group to each decimal digit, restricting each group to values 0 through 9.
- A 16-bit BCD value can represent decimal digits from 0000 through 9999, unlike an ordinary 16-bit unsigned binary value, which reaches 65535.
- BCD was useful for hardware displays such as gas pumps, grocery scales, and Nixie-tube readouts, but conversion between BCD and binary is less straightforward.
- Modern screens have reduced the need for BCD, though older PLCs sometimes included dedicated conversion instructions.
- Gray code is a digital code in which adjacent values differ by only one bit.
- That one-bit transition reduces ambiguity in an absolute encoder when its sensor reads near the boundary between adjacent positions.
- If several bits change simultaneously in ordinary binary, a slow or imperfect read can produce a substantially incorrect position.
- The lecture notes that fragile glass encoder components and the availability of incremental encoders have reduced the use of absolute encoders in many settings.
- A robot singularity is a configuration where the robot’s motion calculation becomes problematic, potentially leaving the controller unable to produce the next commanded move.
- The lecture describes a robot stopping at a singularity and emphasizes planning a path that avoids or moves through the problematic configuration.
- Students are asked to recognize singularity as a recurring issue in robot systems, not as the main focus of the course’s robot material.
Transcript excerpt
0:00 I do try to video my uh classroom uh occurrences and uh that would be expected. I guess this is uh what under hybrid PLC um courses um MIME 4450 is where I'm publishing everything and the syllabus and then projects I I updated that a little bit and this is the one that you did on this weekend and I you may want to review this uh I I may change this a little bit. I'm going to add a few to this. So, if you want to wait for this is for next week's assignment, you may I'm not
0:47 trying to say don't do it. It it's good exercise to do these, but we're trying to um go back and and and you notice that there's no more. So, week three, the assignment is not there yet. And I will put something up this [clears throat] week for for assignment number three. Okay, so that's where we're at. These will be graded back to you hopefully on Thursday. And we try to keep everything up to speed, up to date so that you have 14 of these. These are your I don't know whether they'll be out of 20 or out of a hundred. I have not figured or maybe out of 50. I don't know what I'm going to do yet. But whatever it is, it'll be consistent across the board. Everyone will be the same. So that's that. Now, this is the next next little bit is something that may or may not interest you. You may or may not uh have any interest in in why we study digital
1:39 logic in the middle of this course, but some of you are mechanical engineers and you do not have that background. Some of you have taken the previous course and
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Wm_T Evans.