Bill Cosby was home watching TV. He didn't watch much of it. He tried to get his kids to refrain too, and to read more instead. "I decided to stay up and watch what was on cable. That night I saw three movies about rape . They all seemed designed to do the same thing - show women having their clothes torn off. . . . The next night I watched again. This time I heard people cursing for no reason other than to get a laugh. . . . Next I began to monitor the networks and the independent stations: women degraded, cops-and- robbers shows with the guns getting bigger and bigger. "

He took it all in and said, "I'm tired of shows that consist of a car crash, a gunman and a hooker talking to a black pimp. " But had the public tired of it, too?

Over the past dozen years, Cosby had only appeared on TV in two shows: Both were "family-oriented" and both were disasters. He told writer Bill Davidson that he approached the networks offering "a detective show . . . I would solve crimes with my wits, as Columbo once did, and my girlfriend would be a strong woman with her own career. " There would be "no guns, no violence, no car chases. " The networks said, "No way. "

Cos thought it over again, going back to the basics of his entertainment career. He would do something truthful, something from the heart.

His new sitcom would be the real Cosby, out there and vulnerable, doing humor about human beings - a family's love and understanding. He'd do the kind of bits NBC executive Brandon Tartikoff saw him do on The Tonight Show, talking about his problems as a parent. It would be scheduled together with Tartikoff's pet project Family Ties. Basically the tone of the show would not be that different from Cosby's first situation comedy, with its emphasis on low-key slice-of-life vignettes.

As obstetrician-gynecologist Heathcliff Huxtable, he would handle his five kids' problems and share the chores with his wife, a practicing lawyer. But he'd be laid-back, "a man in search of a perfect nap. " And he'd have his hands full, being "not as in control as I pretend. "

ABC and NBC were both interested. Cosby still had a tremendous "likability quotient," thanks to his commercials - and for commercial TV, that was a big, big selling point. But the networks were still worried about a show based on ''warm, gentle humor. "

ABC backed off. NBC held on but only wanted six episodes. That way they could cut their losses and bury Cos if the show was the same failure his 1976 one was. They weren't even sure of Cosby's name: Heathcliff Huxtable. Heathcliff was OK, kind of funny. But Huxtable was uppity. They asked him to change the name to Brown.

Cosby discovered that some things never changed. His "game face" came on. He took a hard line. He wanted total control and would accept nothing less. He wanted at least 13 weeks to get his show going, not six. Meanwhile, NBC scrutinized old tapes of his Tonight Show appearances. They were looking for Cosby the family man. They found some of it in his new stand-up routines:

"One of the things you learn when you become a parent is the horrible thought and the reality that your children will be your children for the rest of your life! That's why there's death. "

NBC was amused, but, just to make sure, they insisted Cosby do a short pilot show. Knowing the network mind, Cos decided to film a vignette of Dr. Huxtable talking to his daughters about sex. This got NBC's attention and slowly the concessions came.

Behind the scenes, Cosby got involved in endless story conferences, total rewrites, a dissection of each script for motivation and realism.

The show had to be faithful to Cosby's attitudes toward life and comedy. He cautioned his racially mixed writing staff to stay away from sitcom cliche. ''If this was 1964," he said, "my wife could do the cooking and I could be the guy on the sofa who just says, 'Let your mother handle this. ' But today a lot of things have changed and I want the show to reflect those changes. A family where the father cooks, too, and pitches in with the kids, and where everyone has responsibilities. "

Cosby's standards were so tough that three writers quit after the first six episodes. The hectic rewriting and clashing over focus and nuance caused head writer Earl Pomerantz to quit, too.

"Bill challenges you to do your best," he said. "But I must say that I was awfully tired. " Cosby's humor always came from richly defined characters and situations, not from one-liners and cheap sight gags. It was hard to turn out half-hours with as much polish and charm as Cosby's 10-minute monologues. "

Reports on Cosby's family show about upper-middle-class blacks met with the laughter of derision. While he worked on deadline, keeping a close watch on the show's characters, comedy and quality, he had to deal with the doubting, pessimistic reporters.

Bill, why do a family show? Aren't you out of touch? How many whites will be on the show? Will you show the real black American family? What about social problems? What about white versus black? Isn't it a fairy tale to portray blacks as doctors and lawyers? How come you don't talk like George Jefferson or Fred Sanford - isn't that real black dialect? And why aren't you having the family live in the ghetto?

"Why do they want to deny me the pleasure of being an American and just enjoying life? " Cosby responded. "Why must I make all the black social statements? " Why not do a show his way, "a class way . . . something to be proud of . . . to show that we have the same kinds of wants and needs as other American families. "

Looking at sitcoms in the 1980s, the cycle between so-called "blacks in whiteface" and "funky soul families" had spun way off course. New shows had smart blacks - who played maids and butlers to doltish whites. A bizarre fad had almost abnormal black children acting extra-terrestrially superior to the white families that adopted them. The only holdover from the previous decade was The Jeffersons, with its gleeful reverse racism and "honky this" and ''honky that. " And now Cosby was already getting heat for simply showing his conception of a normal, upper-middle-class black family.

At a press conference he told reporters that he would answer only to himself. As for the upper-middle-class black family bit: "My wife plays a lawyer," he enunciated, "and I'm a doctor. For those of you who have a problem with that . . . that's your problem. "

Uh-oh. Boy, Cosby's a little touchy, isn't he?

No, not touchy. Bill Cosby is arrogant!

In 1984, The Cosby Show had barely been on the air for a month when a damaging cover story on Cosby appeared in TV Guide. Its title was a warning: ''Witness the Humors of Bill Cosby . " Writer Kathleen Fury said her interview with Cos "was unpleasant. He made no attempt to be amiable and was by turns combative, defensive, challenging, threatening and hostile . . . one of the most arrogant celebrities I've ever met. "

The piece caused an immediate stir and was quoted by many disgruntled newspapers that had failed to secure private interviews with the increasingly wary Cosby. Even as TV Guide hit the stands, Cosby's show hit No. 1, one of the biggest upsets in TV history.

Who could have predicted it? Not Cos.

When he appeared live on The Phil Donahue Show, viewers could see how deeply disturbed Cosby was by the negative remarks and his constant need to defend his positions. He had been joking with the audience, taking time to explain his point of view on his production of a family show filled with gentle humor when members of the audiences began to ask about blacks versus whites.

What about breaking the cycle of "all-white television? " What about ''black girls running and hugging on white guys" and rock videos where black men are with white girls? Cosby's face clouded with anger. "I would like to right now stop with this program," he said. "I am not an authority on blackness. I didn't come on this program to discuss blackness. I came on this show to discuss human beings and let's get into that. . . . I don't want to spend the time when a black person shows up on a show talking about blackness and what you all have to do in order to make America better. When Bob Newhart comes on here let's have him talk about it. When whatever person comes on let's have them talk about it. Right now, why don't you see if I can be a h-u-m-a-n b-e-i-n-g." The audience applauded.

Describing his vindication as an advocate of family TV, Cosby called his success "a major, major step, not just for the American people but for those who control what goes on the air. The truth is in the numbers, and this helps straighten out nonbelievers concerning what an American audience will watch. "

Many Cosby Show episodes about Cliff Huxtable's son, Theo, are clearly based on Cosby's childhood and his experiences with his real son Ennis. And the relationship between Clair and Cliff Huxtable mirrors Cosby's life with his wife Camille. Phylicia Rashad, who plays Clair, appears to be as aware as Cosby is of the importance of the image they're projecting. "I think Bill and I are great role models as far as our TV professions are concerned. Kids learn by example, and I think we're very good ones. "

Professionally, Cos has the best of both worlds - 10 weeks a year guaranteed at Las Vegas and Atlantic City, and The Cosby Show. He says of his work: "This series is for me a love affair for all the years that I've been a well-paid entertainer. It's my way to say to the people who have enjoyed my work, 'I can do this, and here is a form of entertainment that I hope you will all feel good about. ' I feel as though the love I have to give the people is appreciated. I just want to give more and more and more. "

Personally, Cosby has a happy home, and he has Camille: "My life now is a very, very happy one. It's a happiness of being deeply connected, of knowing that there is someone I can trust completely, and that the one I trust is the one I love. I also know that the one she loves is definitely one she can trust. It is immeasurable, the wisdom she has given me. With her strength and help, I can only become better . . . and I want to . . . because I want her to be proud of me."