From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 29494 invoked from network); 1 Dec 2021 20:30:57 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 1 Dec 2021 20:30:57 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id E9FEA9CE07; Thu, 2 Dec 2021 06:30:53 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id EB3069CD65; Thu, 2 Dec 2021 06:30:06 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id 3EC019C78B; Thu, 2 Dec 2021 06:27:53 +1000 (AEST) Received: from darkstar.fourwinds.com (fourwinds.com [63.64.179.162]) by minnie.tuhs.org (Postfix) with ESMTPS id 9D25494502 for ; Thu, 2 Dec 2021 06:27:52 +1000 (AEST) Received: from darkstar.fourwinds.com (localhost [127.0.0.1]) by darkstar.fourwinds.com (8.16.1/8.15.2) with ESMTP id 1B1KRp5K120960 for ; Wed, 1 Dec 2021 12:27:51 -0800 Received: from darkstar.fourwinds.com (jon@localhost) by darkstar.fourwinds.com (8.16.1/8.15.2/Submit) with ESMTP id 1B1KRp0G120957 for ; Wed, 1 Dec 2021 12:27:51 -0800 Message-Id: <202112012027.1B1KRp0G120957@darkstar.fourwinds.com> From: Jon Steinhart To: TUHS main list In-reply-to: References: Comments: In-reply-to Douglas McIlroy message dated "Wed, 01 Dec 2021 09:55:23 -0500." MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <120955.1638390471.1@darkstar.fourwinds.com> Date: Wed, 01 Dec 2021 12:27:51 -0800 X-JON-SPAM: local delivery Subject: Re: [TUHS] Encoding an ISA: Random Logic vs. Control Stores X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" Douglas McIlroy writes: > My take on defining random logic > > random logic : hardware :: spaghetti code : software I hate to take issue with Doug's explanation since he's a lot smarter than me. In my opinion, spaghetti code is a choice while random logic is not. In both cases, I have an underlying assumption that the hardware designer or coder is implementing someone else's design and doesn't have the ability to say "I could do a cleaner implementation if we could make a design change." While one could almost always do a "regular" implementation instead of a "random" one in hardware the regular one would likely be more expensive in terms of resources like speed, space, cost, and power than the random one. Of course, that's not always true. In the blast from the past department, I had to implement something around 1980 where there was no chance of meeting the timing requirements using random gates. At the time, and my memory is fuzzy here, AMD had a very fast 1Kx8 PROM. Instead of using random logic I used a couple of these, and wrote a compiler that converted logic equations into bit patterns for burning the PROMs. It was actually that project that got me back into doing software. Plus, of course, the fact that our department finally gave up on DEC operating systems and starting running UNIX. Random logic design is way different than it used to be. Back when I was in college, we had a Digital Logic Design course that focused on Karnaugh maps and all that sort of logic minimization stuff. I made a deal with my professor. I'd teach the class instead of taking it and annoying the crap out of him. In addition to the regular class material, I added TI's "The TTL Book". The new idea that I brought to the class was that gates came in packages, and one had to balance logic minimization with package minimization. So for example, if you needed an inverter and none was available but you had an extra NAND gate in a 7400 you could use it as an inverter instead of adding another package of which 5/6 of the gates would be unused. Today, all of this gets handled by CAD packages. The only time that one might have to get down into the dirt is in something like a very tight FPGA design where certain elements are in short supply and can clever misuse of other elements can get what's needed. Anyway, for yet another try, random logic is what you get when implementing an "unclean" specification while minimizing cost and other factors. Sort of like implementing a parser for FORTRAN :-) Speaking of FORTRAN and back to Doug's comment, I'm reminded of yet another story. Some decades ago I was the author of the C language binding for GKS, an absolutely stupid standard graphics package. The original GKS only had a FORTRAN binding, and many people on the ANSI committee were working on bindings for languages that their customers actually wanted. The FORTRAN binding was pretty much what you'd expect. When I did the C binding, among other things I defined a "point" data structure to hold x,y coordinates. At one of the meetings my friend Randy from Sandia complained about it. When pressed, he said that he had a program that started by labeling a map, and it was tedious for him to have code like p.x = 10; p.y = 20; gtext(p, "label"); when in FORTRAN he could just do gtext(10, 20, "label"); Once I understood his issue, I of course had to say "Well, if I was doing a map to monitor the nuclear test ban..." (because it was always fun to have people like him and the NSA person who pretended that we didn't know what they did), I taught him how to put the coordinates and labels into a static data structure making the rest a two-line program. He went back to Sandia and started teaching his peers how to write C in C instead of doing FORTRAN in C. I think that this is somewhat analogous to Doug's comment in that there was a choice on how to write the code, and Sandia's original choice wasn't very good. But, it was a choice, not something required by the specification. Different than, for example, logic that says that "an interrupt is generated when this or that or another goes high and this enable bit is high and this mask bit is low and the global interrupt enable is high." No sensible way to implement this except as a random hunk of logic because it's a one-off. Especially if there are other interrupts such as an NMI that has completely different rules. Hope that this all helps. Jon